Skip to content

Instantly share code, notes, and snippets.

@barraponto
Last active October 28, 2019 17:49
Show Gist options
  • Save barraponto/24596e65a2d874c27596f0e875271b43 to your computer and use it in GitHub Desktop.
Save barraponto/24596e65a2d874c27596f0e875271b43 to your computer and use it in GitHub Desktop.
version: "3.7"
services:
db:
environment:
POSTGRES_PASSWORD: postgres
image: postgres:alpine
ports:
- "5432:5432"
volumes:
- ./docker/db/pgdata:/var/lib/postgresql/data
django: # this just builds the image
build: .
image: myproject/django
web: # actually uses the image to start the server
image: myproject/django
command: python manage.py runserver 0.0.0.0:8000
ports:
- "8000:8000"
volumes:
- .:/usr/local/src
depends_on:
- db
- django
migrate: # also uses the image to run the migrations
command: python manage.py migrate
image: myproject/django
volumes:
- .:/usr/local/src
depends_on:
- db
- django
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment