-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathproduction.yml
127 lines (110 loc) · 2.82 KB
/
production.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
version: "2"
volumes:
postgres_data: {}
postgres_backup: {}
static: {}
media: {}
services:
django-wsgi:
container_name: django-wsgi
build:
context: .
dockerfile: ./compose/django/Dockerfile-prod
expose:
- "5000"
volumes:
- static:/static
- media:/media
depends_on:
- nginx
- postgres
- redis
command: /start_gunicorn.sh
env_file: ./credentials/production.env
environment:
- VIRTUAL_HOST=sushibar.learningequality.org
- VIRTUAL_NETWORK=sushibar_default
- VIRTUAL_PORT=5000
- LETSENCRYPT_HOST=sushibar.learningequality.org
- LETSENCRYPT_EMAIL=ivan@learningequality.org
django-asgi:
container_name: django-asgi
build:
context: .
dockerfile: ./compose/django/Dockerfile-prod
expose:
- "6000"
depends_on:
- redis
command: /start_daphne.sh
env_file: ./credentials/production.env
environment:
- VIRTUAL_HOST=sushibar.learningequality.org
- VIRTUAL_NETWORK=sushibar_default
- VIRTUAL_PORT=6000
- ASGI_UPSTREAM_NAME=sushibar_asgi_upstream
- VIRTUAL_PROTO=http
- HTTPS_METHOD=noredirect
asgi-worker:
container_name: asgi-worker
build:
context: .
dockerfile: ./compose/django/Dockerfile-prod
volumes:
- media:/media
depends_on:
- redis
command: /start_worker.sh
env_file: ./credentials/production.env
postgres:
container_name: sushibar-postgres
build:
context: ./compose/postgres
dockerfile: Dockerfile-prod
volumes:
- postgres_data:/var/lib/postgresql/data
- postgres_backup:/backups
env_file: ./credentials/production.env
redis:
image: redis:3.0
nginx:
restart: always
image: nginx
container_name: nginx
depends_on:
- django-asgi
ports:
- "80:80"
- "443:443"
volumes:
- static:/static
- media:/media
- "/etc/nginx/conf.d"
- "/etc/nginx/vhost.d"
- "/usr/share/nginx/html"
- "./volumes/proxy/certs:/etc/nginx/certs:ro"
nginx-gen:
restart: always
build: ./compose/nginx-gen
container_name: nginx-gen
depends_on:
- nginx
volumes:
- "/var/run/docker.sock:/tmp/docker.sock:ro"
volumes_from:
- nginx
entrypoint: /usr/local/bin/docker-gen -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
letsencrypt-companion:
restart: always
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: letsencrypt-companion
depends_on:
- nginx
- nginx-gen
volumes_from:
- nginx
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./volumes/proxy/certs:/etc/nginx/certs:rw"
environment:
- NGINX_DOCKER_GEN_CONTAINER=nginx-gen