Created
January 30, 2017 13:35
-
-
Save ramboldio/22d368eecfd7105a7c875136f27cc872 to your computer and use it in GitHub Desktop.
Dockerfile Django App
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: '2' | |
services: | |
db: | |
image: postgres | |
environment: | |
POSTGRES_PASSWORD: password | |
volumes: | |
- ./dbdata:/var/lib/postgresql/data | |
web: | |
# Docker hack to wait until Postgres is up, then run stuff. | |
command: bash -c "while ! nc -w 1 -z db 5432; do sleep 0.1; done; ./manage.py migrate; while :; do ./manage.py runserver_plus 0.0.0.0:8000; sleep 1; done" | |
image: django | |
build: . | |
volumes: | |
- .:/code | |
depends_on: | |
- db | |
environment: | |
IN_DOCKER: 1 | |
webserver: | |
image: jumanjiman/caddy | |
depends_on: | |
- web | |
ports: | |
- "80:8000" | |
command: -port 8000 -host 0.0.0.0 "proxy / web:8000 { }" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment