Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #7 #8

Merged
merged 1 commit into from
Nov 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ COPY requirements.txt .
RUN \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y libpq-dev python3-dev && \
apt-get install -y libpq-dev python3-dev postgresql-client && \
python3 -m pip install --upgrade pip && \
python3 -m pip install -r requirements.txt --no-cache-dir && \
apt-get autoclean && \
Expand Down
4 changes: 3 additions & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

echo "DB init..."
until psql -h db -U root -c '\l' &>/dev/null; do
while psql -h db 2>&1 | grep -q 'could not connect to server'; do
>&2 echo "Waiting for PostgreSQL to boot up"
sleep 1
done
Expand All @@ -12,3 +12,5 @@ echo "DB setup: makemigrations..."
echo "DB setup: migrate..."
python3 manage.py makemigrations --noinput
python3 manage.py migrate --noinput

exec "$@"