feat(ci): auto-run alembic migrations and seed on container start
All checks were successful
Deploy to Production / deploy (push) Successful in 44s
All checks were successful
Deploy to Production / deploy (push) Successful in 44s
- Add entrypoint.sh (migrate → seed → uvicorn) - Add python-dotenv to requirements.txt - Backend container uses entrypoint instead of direct uvicorn Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
This commit is contained in:
@@ -20,4 +20,4 @@ ENV PYTHONUNBUFFERED=1
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
CMD ["sh", "scripts/entrypoint.sh"]
|
||||
|
||||
@@ -8,6 +8,9 @@ sqlalchemy[asyncio]==2.0.36
|
||||
asyncpg==0.30.0
|
||||
alembic==1.14.0
|
||||
|
||||
# Env
|
||||
python-dotenv==1.0.1
|
||||
|
||||
# Auth
|
||||
PyJWT==2.9.0
|
||||
bcrypt==4.2.0
|
||||
|
||||
11
scripts/entrypoint.sh
Executable file
11
scripts/entrypoint.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "Running Alembic migrations..."
|
||||
python -m alembic upgrade head
|
||||
|
||||
echo "Running seed data..."
|
||||
python scripts/seed.py
|
||||
|
||||
echo "Starting uvicorn..."
|
||||
exec uvicorn main:app --host 0.0.0.0 --port 8000
|
||||
Reference in New Issue
Block a user