Commit 0c1eedd1 authored by John Alcher's avatar John Alcher
Browse files

Ensure PostgreSQL is running before booting the web service

parent 4b866ef5
......@@ -16,6 +16,8 @@ services:
env_file:
- ./.env.dev
stdin_open: true
depends_on:
- db
db:
container_name: db
......
......@@ -22,3 +22,6 @@ COPY . .
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
RUN npm install frontend/
# run entrypoint.sh
ENTRYPOINT ["/usr/src/web/entrypoint.sh"]
\ No newline at end of file
#!/bin/sh
if [ "$DATABASE" = "postgres" ]
then
echo "Waiting for postgres..."
while ! nc -z $SQL_HOST $SQL_PORT; do
sleep 0.1
done
echo "PostgreSQL started"
fi
exec "$@"
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment