Created
June 27, 2020 05:31
-
-
Save ezesundayeze/3cc4c4fd2eb544193d01e6d4f1511c1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# everything in .env including this below | |
... | |
DB_HOST=db | |
DATASBASE= | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POSTGRES_USER= | |
POSTGRES_PASSWORD= | |
POSTGRES_DB= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.7' | |
services: | |
web: | |
build: ./ | |
command: 'gunicorn internplug.wsgi:application --bind 0.0.0.0:8000' | |
container_name: internplug | |
volumes: | |
- './:/usr/src/app/' | |
ports: | |
- '8000:8000' | |
env_file: | |
- ./.env.prod.db | |
depends_on: | |
- db | |
db: | |
image: 'postgres' | |
container_name: internplug_db | |
volumes: | |
- 'postgres_data:/var/lib/postgresql/data/' | |
env_file: | |
- ./.env.prod.db | |
volumes: | |
postgres_data: null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "$DATABASE" = "internplug2" ] | |
then | |
echo "Waiting for postgres..." | |
while ! nc -z $SQL_HOST $SQL_PORT; do | |
sleep 0.1 | |
done | |
echo "PostgreSQL started" | |
fi | |
python manage.py makemigrations | |
python manage.py makemigrations accounts | |
python manage.py makemigrations emails | |
python manage.py makemigrations jobs | |
python manage.py makemigrations main | |
exec "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment