forked from PecanProject/pecan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
318 lines (294 loc) · 9.85 KB
/
docker-compose.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
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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
version: "3"
services:
# webserver to handle all traffic. This can use let's encrypt to generate a SSL cert.
traefik:
image: traefik:1.7
command:
- --loglevel=INFO
- --api
# Entrypoints
- --defaultentrypoints=https,http
- --entryPoints=Name:http Address::${TRAEFIK_HTTP_PORT:-8000} ${TRAEFIK_HTTP_REDIRECT:-""}
- --entryPoints=Name:https Address::${TRAEFIK_HTTPS_PORT:-8443} ${TRAEFIK_HTTPS_OPTIONS:-TLS}
# Configuration for acme (https://letsencrypt.org/)
- --acme=${TRAEFIK_ACME_ENABLE:-false}
#- --acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
- --acme.email=${TRAEFIK_ACME_EMAIL:-""}
- --acme.entrypoint=https
- --acme.onhostrule=true
- --acme.storage=/config/acme.json
- --acme.httpchallenge.entrypoint=http
- --acme.storage=/config/acme.json
- --acme.acmelogging=true
# DOCKER
- --docker=true
- --docker.endpoint=unix:///var/run/docker.sock
- --docker.exposedbydefault=false
- --docker.watch=true
restart: unless-stopped
networks:
- pecan
ports:
- "${TRAEFIK_HTTP_PORT-8000}:${TRAEFIK_HTTP_PORT:-8000}"
- "${TRAEFIK_HTTPS_PORT-8443}:${TRAEFIK_HTTPS_PORT:-8443}"
labels:
- "traefik.enable=true"
- "traefik.backend=traefik"
- "traefik.port=8080"
- "traefik.frontend.rule=${TRAEFIK_FRONTEND_RULE:-}PathPrefixStrip: /traefik"
- "traefik.website.frontend.whiteList.sourceRange=${TRAEFIK_IPFILTER:-172.16.0.0/12}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- traefik:/config
# Allow to see all docker containers running, restart and see log files.
portainer:
image: portainer/portainer:latest
command:
- --admin-password=${PORTAINER_PASSWORD:-}
- --host=unix:///var/run/docker.sock
restart: unless-stopped
networks:
- pecan
labels:
- "traefik.enable=true"
- "traefik.backend=portainer"
- "traefik.frontend.rule=${TRAEFIK_FRONTEND_RULE:-}PathPrefixStrip: /portainer"
- "traefik.website.frontend.whiteList.sourceRange=${TRAEFIK_IPFILTER:-172.16.0.0/12}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer:/data
# ----------------------------------------------------------------------
# Access to the files generated and used by PEcAn, both through a
# web interface (minio) as well using the thredds server.
# ----------------------------------------------------------------------
# webserver to handle access to data
minio:
image: minio/minio:latest
command: server /data
restart: unless-stopped
networks:
- pecan
environment:
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY:-carya}
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY:-illinois}
labels:
- "traefik.enable=true"
- "traefik.backend=minio"
- "traefik.port=9000"
- "traefik.frontend.rule=${TRAEFIK_FRONTEND_RULE:-}PathPrefix:/minio/"
volumes:
- pecan:/data
# THREDDS data server
thredds:
image: pecan/thredds:${PECAN_VERSION:-latest}
restart: unless-stopped
networks:
- pecan
volumes:
- pecan:/data
labels:
- "traefik.enable=true"
- "traefik.port=8080"
- "traefik.frontend.rule=${TRAEFIK_FRONTEND_RULE:-}PathPrefix:/thredds"
- "traefik.backend=thredds"
# ----------------------------------------------------------------------
# Job management system. Jobs are distributed through the message
# system. PEcAn uses this to distribute the work/load across multiple
# containers.
# ----------------------------------------------------------------------
# rabbitmq to connect to extractors
rabbitmq:
image: rabbitmq:management
restart: unless-stopped
networks:
- pecan
environment:
- RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbitmq_management path_prefix "/rabbitmq"
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER:-guest}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS:-guest}
labels:
- "traefik.enable=true"
- "traefik.backend=rabbitmq"
- "traefik.port=15672"
- "traefik.frontend.rule=${TRAEFIK_FRONTEND_RULE:-}PathPrefix:/rabbitmq"
- "traefik.website.frontend.whiteList.sourceRange=${TRAEFIK_IPFILTER:-172.16.0.0/12}"
volumes:
- rabbitmq:/var/lib/rabbitmq
# ----------------------------------------------------------------------
# Database to hold the data from PEcAn and BETY.
# ----------------------------------------------------------------------
# postgresql + postgis to hold all the data
postgres:
image: mdillon/postgis:9.5
restart: unless-stopped
networks:
- pecan
volumes:
- postgres:/var/lib/postgresql/data
# ----------------------------------------------------------------------
# BETY rails frontend to the database
# ----------------------------------------------------------------------
bety:
image: pecan/bety:${BETY_VERSION:-latest}
restart: unless-stopped
networks:
- pecan
environment:
- UNICORN_WORKER_PROCESSES=1
- SECRET_KEY_BASE=${BETY_SECRET_KEY:-notasecret}
- RAILS_RELATIVE_URL_ROOT=/bety
- LOCAL_SERVER=${BETY_LOCAL_SERVER:-99}
depends_on:
- postgres
labels:
- "traefik.enable=true"
- "traefik.frontend.rule=${TRAEFIK_FRONTEND_RULE:-}PathPrefix:/bety/"
- "traefik.backend=bety"
# ----------------------------------------------------------------------
# RStudio
# ----------------------------------------------------------------------
rstudio-nginx:
image: pecan/rstudio-nginx:${PECAN_VERSION:-latest}
networks:
- pecan
labels:
- "traefik.enable=true"
- "traefik.backend=rstudio"
- "traefik.port=80"
- "traefik.frontend.rule=${TRAEFIK_FRONTEND_RULE:-}PathPrefix:/rstudio"
- "traefik.website.frontend.whiteList.sourceRange=${TRAEFIK_IPFILTER:-172.16.0.0/12}"
rstudio:
image: pecan/base:${PECAN_VERSION:-latest}
restart: unless-stopped
networks:
- pecan
environment:
- USER=${PECAN_RSTUDIO_USER:-carya}
- PASSWORD=${PECAN_RSTUDIO_PASS:-illinois}
entrypoint: /init
volumes:
- pecan:/data
- rstudio:/home
# ----------------------------------------------------------------------
# PEcAn application
# ----------------------------------------------------------------------
# PEcAn documentation as well as PEcAn home page
docs:
image: pecan/docs:${PECAN_VERSION:-latest}
restart: unless-stopped
networks:
- pecan
labels:
- "traefik.enable=true"
- "traefik.frontend.rule=${TRAEFIK_FRONTEND_RULE:-}PathPrefix:/"
- "traefik.backend=docs"
# PEcAn web front end, this is just the PHP code
web:
image: pecan/web:${PECAN_VERSION:-latest}
restart: unless-stopped
networks:
- pecan
environment:
- RABBITMQ_URI=${RABBITMQ_URI:-amqp://guest:guest@rabbitmq/%2F}
- FQDN=${PECAN_FQDN:-docker}
- NAME=${PECAN_NAME:-docker}
depends_on:
- postgres
- rabbitmq
labels:
- "traefik.enable=true"
- "traefik.frontend.rule=${TRAEFIK_FRONTEND_RULE:-}PathPrefix:/pecan/"
- "traefik.backend=pecan"
volumes:
- pecan:/data
- pecan:/var/www/html/pecan/data
# PEcAn model monitor
monitor:
image: pecan/monitor:${PECAN_VERSION:-latest}
restart: unless-stopped
networks:
- pecan
ports:
- 9999:9999
environment:
- RABBITMQ_URI=${RABBITMQ_URI:-amqp://guest:guest@rabbitmq/%2F}
- FQDN=${PECAN_FQDN:-docker}
depends_on:
- rabbitmq
labels:
- "traefik.enable=true"
- "traefik.frontend.rule=${TRAEFIK_FRONTEND_RULE:-}PathPrefixStrip:/monitor/"
- "traefik.backend=monitor"
volumes:
- pecan:/data
# PEcAn executor, executes jobs. Does not the actual models
executor:
image: pecan/executor:${PECAN_VERSION:-latest}
restart: unless-stopped
networks:
- pecan
environment:
- RABBITMQ_URI=${RABBITMQ_URI:-amqp://guest:guest@rabbitmq/%2F}
- FQDN=${PECAN_FQDN:-docker}
depends_on:
- postgres
- rabbitmq
volumes:
- pecan:/data
# ----------------------------------------------------------------------
# PEcAn models, list each model you want to run below
# ----------------------------------------------------------------------
# PEcAn sipnet model runner
sipnet:
image: pecan/model-sipnet-r136:${PECAN_VERSION:-latest}
restart: unless-stopped
networks:
- pecan
environment:
- RABBITMQ_URI=${RABBITMQ_URI:-amqp://guest:guest@rabbitmq/%2F}
depends_on:
- rabbitmq
volumes:
- pecan:/data
# PEcAn ED model runner
ed2:
image: pecan/model-ed2-git:${PECAN_VERSION:-latest}
restart: unless-stopped
networks:
- pecan
environment:
- RABBITMQ_URI=${RABBITMQ_URI:-amqp://guest:guest@rabbitmq/%2F}
depends_on:
- rabbitmq
volumes:
- pecan:/data
# PEcAn MAESPA model runner
maespa:
image: pecan/model-maespa-git:${PECAN_VERSION:-latest}
restart: unless-stopped
networks:
- pecan
environment:
- RABBITMQ_URI=${RABBITMQ_URI:-amqp://guest:guest@rabbitmq/%2F}
depends_on:
- rabbitmq
volumes:
- pecan:/data
# ----------------------------------------------------------------------
# Name of network to be used by all containers
# ----------------------------------------------------------------------
networks:
pecan:
# ----------------------------------------------------------------------
# Volumes used by the PEcAn stack. These volumes are used to make sure
# we have persistent data. You can use add the commented section to your
# docker-compose.override.yml to have the docker volumes placed at a
# specific location.
# ----------------------------------------------------------------------
volumes:
traefik:
postgres:
rabbitmq:
pecan:
portainer:
rstudio: