-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
122 lines (114 loc) · 2.88 KB
/
docker-compose.yaml
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
version: "3.7"
services:
nginx:
build: ./nginx
image: shane-smwc-web-nginx:latest
env_file: settings.env
deploy:
mode: global
resources:
limits:
cpus: "2.0"
memory: 50M
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik-public"
- "traefik.constraint-label=traefik-public"
- "traefik.http.routers.STACK_NAME-http.rule=Host(${TRAEFIK_HOST})"
- "traefik.http.routers.STACK_NAME-http.entrypoints=http"
- "traefik.http.routers.STACK_NAME-http.middlewares=https-redirect"
- "traefik.http.routers.STACK_NAME-https.rule=Host(${TRAEFIK_HOST})"
- "traefik.http.routers.STACK_NAME-https.entrypoints=https"
- "traefik.http.routers.STACK_NAME-https.tls=true"
- "traefik.http.services.STACK_NAME.loadbalancer.server.port=80"
- "traefik.http.services.STACK_NAME.loadbalancer.server.scheme=http"
volumes:
- /data/docker/smwc-web:/data
secrets:
- source: cssnr_basic_http_auth
target: /etc/nginx/auth.users
depends_on:
- app
ports:
- "80:80"
app:
build: ./app
image: shane-smwc-web-app:latest
env_file: settings.env
command: "gunicorn smwc_web.wsgi:application -w 2 -b 0.0.0.0:9000"
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:9000/app-health-check/"]
interval: 1m
timeout: 10s
retries: 3
start_period: 30s
deploy:
mode: global
resources:
limits:
cpus: "2.0"
memory: 400M
volumes:
- /data/docker/smwc-web:/data
depends_on:
- redis
worker:
image: shane-smwc-web-app:latest
env_file: settings.env
command: "watchmedo auto-restart -d /app -p '*.py' -R -- celery -A smwc_web worker -l INFO -c 4"
deploy:
replicas: 1
resources:
limits:
cpus: "2.0"
memory: 250M
volumes:
- /data/docker/smwc-web:/data
depends_on:
- app
- redis
beat:
image: shane-smwc-web-app:latest
env_file: settings.env
command: "celery -A smwc_web beat -l INFO -S django"
deploy:
replicas: 1
resources:
limits:
cpus: "2.0"
memory: 150M
depends_on:
- app
- redis
# flower:
# image: mher/flower:1.2
# env_file: settings.env
# deploy:
# replicas: 1
# resources:
# limits:
# cpus: '2.0'
# memory: 100M
# volumes:
# - flower_data:/data
# depends_on:
# - redis
# - app
redis:
image: redis:6-alpine
command: "redis-server --appendonly yes"
deploy:
replicas: 1
resources:
limits:
cpus: "2.0"
memory: 50M
volumes:
- redis_data:/data
secrets:
cssnr_basic_http_auth:
file: ~/basic_http_auth
volumes:
data_dir:
flower_data:
redis_data: