fix: add pgdata volume for persistence + fix seed path

This commit is contained in:
Forge
2026-03-19 01:11:51 +08:00
parent a1faa9cf3a
commit fe839cb6ae
3 changed files with 7 additions and 3 deletions

View File

@@ -1,7 +1,6 @@
"""Seed demo data for ServeSync"""
import sys
import os
sys.path.insert(0, '/app')
from sqlalchemy.orm import Session
from app.database import engine, SessionLocal

View File

@@ -15,7 +15,7 @@ except Exception as e:
done
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..."
exec uvicorn app.main:app --host 0.0.0.0 --port 8000

View File

@@ -7,11 +7,13 @@ services:
POSTGRES_DB: servesync
POSTGRES_USER: servesync
POSTGRES_PASSWORD: servesync
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U servesync"]
interval: 5s
timeout: 5s
retries: 5
retries: 10
redis:
image: redis:7-alpine
@@ -47,3 +49,6 @@ services:
- backend
- frontend
restart: unless-stopped
volumes:
pgdata: