chore(prod): startup migrations, readiness checks and backend healthcheck
- add backend entrypoint that can run alembic upgrade head on startup - add RUN_MIGRATIONS_ON_STARTUP setting and compose wiring - add /health/live and /health/ready endpoints with db+redis checks - add backend container healthcheck against readiness endpoint - document readiness and startup migration behavior
This commit is contained in:
12
docker/backend-entrypoint.sh
Normal file
12
docker/backend-entrypoint.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
echo "[entrypoint] starting backend container"
|
||||
|
||||
if [ "${RUN_MIGRATIONS_ON_STARTUP:-false}" = "true" ]; then
|
||||
echo "[entrypoint] running alembic migrations"
|
||||
alembic upgrade head
|
||||
fi
|
||||
|
||||
echo "[entrypoint] launching application"
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user