File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/sh
2+ set -eu
3+
24# Wait for PostgreSQL to be ready
3- until PGPASSWORD=" $POSTGRES_PASSWORD " pg_isready -h db -p 5432 -U " $POSTGRES_USER " ; do
5+ until PGPASSWORD=" $POSTGRES_PASSWORD " pg_isready -h db -p 5432 -U " $POSTGRES_USER " -d " $POSTGRES_DB " ; do
46 echo " Waiting for postgres..."
57 sleep 2
68done
79echo " PostgreSQL is ready!"
810
9- echo " Don't need to apply migrations to a blank DB"
10- echo " Starting the application... Seed data will be applied if MODE=development"
11- uvicorn main:app --host 0.0.0.0 --port 8000 --reload
11+ echo " Applying migrations..."
12+ alembic upgrade head
13+ echo " Migrations applied!"
14+
15+ echo " Starting the application..."
16+ if [ " ${UVICORN_RELOAD:- false} " = " true" ]; then
17+ exec uvicorn main:app --host 0.0.0.0 --port 8000 --reload
18+ else
19+ exec uvicorn main:app --host 0.0.0.0 --port 8000
20+ fi
You can’t perform that action at this time.
0 commit comments