Last active
October 28, 2019 17:49
-
-
Save barraponto/24596e65a2d874c27596f0e875271b43 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
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