Run migrations via entrypoint (alembic upgrade head) instead of nested asyncio.run in startup hook
Some checks failed
build-and-deploy / build (push) Failing after 16s
Some checks failed
build-and-deploy / build (push) Failing after 16s
This commit is contained in:
parent
985fedec7b
commit
0a6da2f9c1
3 changed files with 17 additions and 6 deletions
10
app/docker-entrypoint.sh
Normal file
10
app/docker-entrypoint.sh
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
# App entrypoint: apply migrations, then launch the API.
|
||||
set -e
|
||||
|
||||
cd /app
|
||||
echo "[entrypoint] running migrations..."
|
||||
alembic upgrade head
|
||||
|
||||
echo "[entrypoint] starting uvicorn..."
|
||||
exec uvicorn app.main:app --host 0.0.0.0 --port 8000
|
||||
Loading…
Reference in a new issue