-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker-compose.override.yml_example
239 lines (211 loc) · 6.53 KB
/
docker-compose.override.yml_example
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
version: "3.9"
### to customize the homepage, uncomment this
# x-app:
# image: escriptorium:latest
# volumes:
# - $PWD/app/homepage
services:
web: &web
restart: always
### to customize the homepage, uncomment this
# environment:
# - CUSTOM_HOME=True
# deploy:
# mode: replicated
# replicas: 1
# placement:
# constraints:
# - node.hostname == frontend0
channelserver:
restart: always
# deploy:
# mode: replicated
# replicas: 1
# placement:
# constraints:
# - node.hostname == frontend0
db:
restart: always
# deploy:
# mode: replicated
# replicas: 1
# placement:
# constraints:
# - node.hostname == db0
# For development purposes, expose db on localhost
# ports:
# - 127.0.0.1:5432:5432
redis:
restart: always
# For development purposes, expose redis on localhost
# ports:
# - 127.0.0.1:6379:6379
# uncomment this in conjunction with DISABLE_ELASTICSEARCH to enable the search
# elasticsearch:
# restart: always
# image: docker.elastic.co/elasticsearch/elasticsearch:7.17.0
# environment:
# - cluster.name=docker-cluster
# - bootstrap.memory_lock=true
# - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
# - discovery.type=single-node
# volumes:
# - esdata:/usr/share/elasticsearch/data
nginx:
restart: always
ports:
- "80:80"
# - "443:443"
# deploy:
# mode: replicated
# replicas: 1
# placement:
# constraints:
# - node.hostname == frontend0
### To enable SSL, generate keys (eg with letsencrypt/certbot)
### copy nginx/ssl_certificates.conf_example and edit it
## if need be to correspond to the volume below
### and uncomment this block and the port 443
# volumes:
# - type: bind
# source: $PWD/nginx/ssl.conf
# target: /etc/nginx/conf.d/nginx.conf
# - type: bind
# source: $PWD/nginx/ssl_certificates.conf
# target: /etc/nginx/conf.d/ssl_certificates.conf
# - $PWD/nginx/certs/:/etc/certs/
flower:
restart: always
# deploy:
# mode: replicated
# replicas: 1
# placement:
# constraints:
# - node.hostname == frontend0
# cpus and mem_limit imposes a hard limit on cpus usage,
# needed to keep some for http/db when working with a single machine
#
# according to the docker documentation:
# Memory reservation is a kind of memory soft limit that allows for greater sharing of memory.
# Under normal circumstances, containers can use as much of the memory as needed and are constrained only by the hard limits set with the -m/--memory option (mem_limit in docker-compose).
# When memory reservation is set, Docker detects memory contention or low memory and forces containers to restrict their consumption to a reservation limit.
# the shm_size argument is needed when using KRAKEN_TRAINING_LOAD_THREADS
# !!!!
# example values here are given for 16 cores and 16g of memory keeping 2 cores and 1g of memory at all time
# for http & db assuming a low amount of concurrent users <50
celery-main: &celery-main
restart: always
# deploy:
# mode: replicated
# replicas: 1
# placement:
# constraints:
# - node.hostname == compute0
# resources:
# limits:
# cpus: '6'
# memory: 15g
# reservations:
# memory: 4g
celery-low-priority:
restart: always
# deploy:
# mode: replicated
# replicas: 1
# placement:
# constraints:
# - node.hostname == compute1
# resources:
# limits:
# cpus: '2'
# memory: 15g
# reservations:
# memory: 1g
celery-gpu:
restart: always
# deploy:
# mode: replicated
# replicas: 1
# placement:
# constraints:
# - node.labels.type == gpu
# resources:
# limits:
# cpus: '6'
# memory: 15g
# reservations:
# memory: 1g
# devices:
# - capabilities:
# - gpu
# shm_size: '3gb'
# runtime: nvidia
# environment:
# - KRAKEN_TRAINING_DEVICE=cuda:0
# - NVIDIA_VISIBLE_DEVICES=all
# - NVIDIA_DRIVER_CAPABILITIES=all
# add more workers for every physical gpu
# celery-gpu2:
# <<: *celery-gpu
# environment:
# - KRAKEN_TRAINING_DEVICE=cuda:1
# Needed to enable text alignment with passim!
# unfortunately need to replicate everything because docker-compose only understands one level of inheritance..
# celery-jvm:
# image: registry.gitlab.com/scripta/escriptorium:latest
# build:
# context: .
# env_file: variables.env
# volumes:
# - static:/usr/src/app/static
# - media:/usr/src/app/media
# command: "celery -A escriptorium worker -l INFO -E -Ofair --prefetch-multiplier 1 -Q jvm -c 1 --max-tasks-per-child=1"
# celerybeat:
# restart: always
prometheus:
image: prom/prometheus:v2.1.0
volumes:
- ./prometheus/:/etc/prometheus/
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
ports:
- 9090:9090
# links:
# - alertmanager:alertmanager
alertmanager:
image: prom/alertmanager:v0.18.0
deploy:
replicas: 1
volumes:
- ./prometheus/alertmanager.yml:/etc/alertmanager/alertmanager.yml
- ./prometheus/email.tmpl:/etc/alertmanager/email.tmpl
command:
- '--config.file=/etc/alertmanager/alertmanager.yml'
- '--storage.path=/alertmanager'
- '--log.level=debug'
container-exporter:
image: prom/container-exporter
volumes:
- /sys/fs/cgroup:/cgroup
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 9104:9104
#volumes:
# static:
# driver: local
# driver_opts:
# type: none
# o: 'bind'
# device: $PWD/static/
# prometheus_data: {}
#
# media:
# driver: local
# driver_opts:
# type: none
# o: 'bind'
# device: $PWD/media/