-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduction.yml
60 lines (54 loc) · 1.81 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
version: '3'
services:
django: &django
image: public.ecr.aws/i4c2l4g3/understory:django_latest
depends_on:
- postgres
env_file:
- .env
environment:
- DJANGO_SETTINGS_MODULE=understory.settings.production
container_name: understory_production_django
volumes:
- ./static:/code/static # whitenoise handles this. Ensure user running docker has r/w.
- ./media:/code/media # nginx. Ensure user running docker has r/w.
ports:
- "8000:5000"
command: /start
restart: unless-stopped # Don't enable while originally configuring.
nginx:
image: nginx:1.21.6-alpine
restart: unless-stopped # Don't enable while originally configuring.
depends_on:
- django
volumes:
- ./media:/usr/share/nginx/media:ro
- ./compose/production/nginx/default.conf:/etc/nginx/conf.d/default.conf
postgres:
# image: public.ecr.aws/i4c2l4g3/understory:${POSTGRES_VERSION}
image: public.ecr.aws/i4c2l4g3/understory:postgres_latest
restart: unless-stopped # Don't enable while originally configuring.
volumes:
- ./production_postgres_data:/var/lib/postgresql/data:Z
- ./production_postgres_data_backups:/backups:z
env_file:
- .env
ports:
- "5432:5432"
traefik:
image: traefik:v2.6.3
restart: unless-stopped # Don't enable while originally configuring.
depends_on:
- django
volumes:
- ./production_traefik:/etc/traefik/acme:z
- ./compose/production/traefik/traefik.yml:/etc/traefik/traefik.yml
# Enable gzip compression (maybe?)
labels:
- "traefik.http.middlewares.test-compress.compress=true"
ports:
- "0.0.0.0:80:80"
- "0.0.0.0:443:443"
# - "0.0.0.0:5555:5555"
# - "0.0.0.0:8080:8080"
# command: --api.insecure=true --providers.docker