Skip to content

Commit 9a112cf

Browse files
[entrypoint] Add no reloading for frontend CI/CD
1 parent 53172a5 commit 9a112cf

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

entrypoint.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
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
68
done
79
echo "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

0 commit comments

Comments
 (0)