Skip to content

Instantly share code, notes, and snippets.

@ezesundayeze
Created June 27, 2020 05:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ezesundayeze/3cc4c4fd2eb544193d01e6d4f1511c1d to your computer and use it in GitHub Desktop.
Save ezesundayeze/3cc4c4fd2eb544193d01e6d4f1511c1d to your computer and use it in GitHub Desktop.
# everything in .env including this below
...
DB_HOST=db
DATASBASE=
...
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_DB=
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
#!/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