2019-02-20 16:18:12 +00:00
|
|
|
version: '3'
|
|
|
|
services:
|
2019-02-20 20:29:49 +00:00
|
|
|
nginx:
|
2019-02-20 20:04:07 +00:00
|
|
|
image: jwilder/nginx-proxy:alpine
|
|
|
|
restart: always
|
|
|
|
ports:
|
|
|
|
- "80:80"
|
|
|
|
- "443:443"
|
|
|
|
labels:
|
|
|
|
- com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy
|
|
|
|
volumes:
|
|
|
|
- gunicorn-socket:/var/gunicorn # to talk to Django
|
|
|
|
- /var/run/docker.sock:/tmp/docker.sock:ro # for nginx-proxy
|
|
|
|
- conf:/etc/nginx/conf.d
|
|
|
|
- vhost:/etc/nginx/vhost.d
|
|
|
|
- html:/usr/share/nginx/html
|
|
|
|
- certs:/etc/nginx/certs:ro
|
|
|
|
networks:
|
|
|
|
- nginx_network
|
|
|
|
letsencrypt:
|
|
|
|
image: jrcs/letsencrypt-nginx-proxy-companion
|
2019-02-20 20:12:48 +00:00
|
|
|
restart: always
|
2019-02-20 20:04:07 +00:00
|
|
|
volumes:
|
|
|
|
- gunicorn-socket:/var/gunicorn
|
|
|
|
- conf:/etc/nginx/conf.d
|
|
|
|
- vhost:/etc/nginx/vhost.d
|
|
|
|
- html:/usr/share/nginx/html
|
|
|
|
- certs:/etc/nginx/certs:rw
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
|
|
networks:
|
|
|
|
- nginx_network
|
|
|
|
depends_on:
|
2019-02-20 20:29:49 +00:00
|
|
|
- nginx
|
2019-02-20 16:18:12 +00:00
|
|
|
db:
|
|
|
|
restart: always
|
|
|
|
networks:
|
|
|
|
- database_network
|
2019-02-20 20:04:07 +00:00
|
|
|
depends_on:
|
|
|
|
- letsencrypt
|
2019-02-21 10:26:55 +00:00
|
|
|
django:
|
2019-02-20 16:18:12 +00:00
|
|
|
restart: always
|
|
|
|
volumes:
|
|
|
|
- gunicorn-socket:/var/gunicorn
|
|
|
|
- ./config/gunicorn.conf.py:/config/gunicorn.conf.py
|
|
|
|
networks:
|
|
|
|
- database_network
|
|
|
|
- nginx_network
|
|
|
|
environment:
|
|
|
|
- ENVIRONMENT=production
|
|
|
|
- DJANGO_SETTINGS_MODULE=backend.settings.production
|
2019-02-20 20:04:07 +00:00
|
|
|
- VIRTUAL_HOST
|
|
|
|
- LETSENCRYPT_HOST
|
|
|
|
- LETSENCRYPT_EMAIL
|
2019-02-20 16:18:12 +00:00
|
|
|
networks:
|
|
|
|
database_network:
|
|
|
|
driver: bridge
|
|
|
|
nginx_network:
|
|
|
|
driver: bridge
|
|
|
|
volumes:
|
2019-02-20 20:04:07 +00:00
|
|
|
gunicorn-socket:
|
|
|
|
conf:
|
|
|
|
vhost:
|
|
|
|
html:
|
|
|
|
certs:
|
|
|
|
|