fix: add pgdata volume for persistence + fix seed path
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
"""Seed demo data for ServeSync"""
|
"""Seed demo data for ServeSync"""
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
sys.path.insert(0, '/app')
|
|
||||||
|
|
||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from app.database import engine, SessionLocal
|
from app.database import engine, SessionLocal
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ except Exception as e:
|
|||||||
done
|
done
|
||||||
|
|
||||||
echo "Running seed..."
|
echo "Running seed..."
|
||||||
python seed.py || echo "Seed already ran or error (continuing)"
|
cd /app && python seed.py 2>&1 && echo "Seed complete" || echo "Seed failed or already ran (continuing)"
|
||||||
|
|
||||||
echo "Starting server..."
|
echo "Starting server..."
|
||||||
exec uvicorn app.main:app --host 0.0.0.0 --port 8000
|
exec uvicorn app.main:app --host 0.0.0.0 --port 8000
|
||||||
|
|||||||
@@ -7,11 +7,13 @@ services:
|
|||||||
POSTGRES_DB: servesync
|
POSTGRES_DB: servesync
|
||||||
POSTGRES_USER: servesync
|
POSTGRES_USER: servesync
|
||||||
POSTGRES_PASSWORD: servesync
|
POSTGRES_PASSWORD: servesync
|
||||||
|
volumes:
|
||||||
|
- pgdata:/var/lib/postgresql/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U servesync"]
|
test: ["CMD-SHELL", "pg_isready -U servesync"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 10
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:7-alpine
|
image: redis:7-alpine
|
||||||
@@ -47,3 +49,6 @@ services:
|
|||||||
- backend
|
- backend
|
||||||
- frontend
|
- frontend
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
pgdata:
|
||||||
|
|||||||
Reference in New Issue
Block a user