Skip to content

Instantly share code, notes, and snippets.

@webus
Created August 8, 2017 20:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webus/bf089e5a30c4ab13790642d890965696 to your computer and use it in GitHub Desktop.
Save webus/bf089e5a30c4ab13790642d890965696 to your computer and use it in GitHub Desktop.
django / caddy / docker-compose
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d db caddy redis
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build app
version: '2'
services:
caddy:
image: abiosoft/caddy:0.10.2
volumes:
- "./Caddyfile:/etc/Caddyfile"
- "./.caddy:/root/.caddy"
ports:
- "80:80"
- "443:443"
volumes_from:
- app
app:
volumes:
- "./mediafiles:/usr/src/app/mediafiles"
version: '2'
services:
db:
image: postgres:9.6
environment:
- POSTGRES_PASSWORD=secret
volumes:
- "./data:/var/lib/postgresql/data"
redis:
image: redis:3-alpine
app:
build: .
depends_on:
- db
env_file:
- ./.app.env
FROM python:3.5.3-onbuild
VOLUME ["/usr/src/app/staticfiles"]
CMD ["gunicorn", "--access-logfile", "-", "--error-logfile", "-", "-b", "0.0.0.0:8000", "app.wsgi", "-w", "4", "--preload"]
EXPOSE 8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment