fix(backend): never run seed.py in production
All checks were successful
CI/CD → Deploy via SSH / Build & Push Docker Images (push) Successful in 38s
CI/CD → Deploy via SSH / Deploy via SSH (push) Successful in 3m12s
CI/CD → Deploy via SSH / Validate HTTPS & Endpoints (push) Successful in 1m8s

entrypoint.sh now requires RUN_SEED=true to execute the seed script.
Without it, only 'flask db upgrade heads' runs on container start.

docker-compose.yml (dev) sets RUN_SEED=true and RUN_CSV_IMPORT=true
so local development behaviour is unchanged.

Production (docker-compose.prod.yml) does not set these variables,
so the database is no longer wiped on every deploy.
This commit is contained in:
MatheusAlves96 2026-04-23 00:03:56 -03:00
parent e1a1f71fbd
commit d99978cd7a
2 changed files with 12 additions and 4 deletions

View file

@ -28,6 +28,8 @@ services:
FLASK_ENV: development
FLASK_APP: app
CORS_ORIGINS: http://localhost:${PORT_FRONTEND:-5173}
RUN_SEED: "true"
RUN_CSV_IMPORT: "true"
volumes:
# Hot-reload: bind-mount app code so Flask reloader picks up changes
- ./backend/app:/app/app