-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
363 lines (349 loc) · 12.3 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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
version: "3"
services:
frontend:
image: docker-registry.crim.ca/geoimagenet/frontend:1.8.3
container_name: frontend
environment:
- USING_GEOIMAGENET_COMPOSE=${USING_GEOIMAGENET_COMPOSE:?Please use geoimagenet-compose.sh script instead}
- GEOIMAGENET_VERSION=0.8.4
- SERVER_PROTOCOL=https://
- GEOSERVER_URL=https://${HOST_FQDN}/geoserver
- MAGPIE_ENDPOINT=https://${HOST_FQDN}/magpie
- GRAPHQL_ENDPOINT=https://${HOST_FQDN}/graphql
- ML_ENDPOINT=https://${HOST_FQDN}/ml
- GEOIMAGENET_API_URL=https://${HOST_FQDN}/api/v1
- ANNOTATION_NAMESPACE_URI=GeoImageNet
- ANNOTATION_NAMESPACE=GeoImageNet
- ANNOTATION_LAYER=annotation
- CONTACT_EMAIL=${CONTACT_EMAIL}
- FRONTEND_JS_SENTRY_DSN=${FRONTEND_JS_SENTRY_DSN}
- FRONTEND_PYTHON_SENTRY_DSN=${FRONTEND_PYTHON_SENTRY_DSN}
volumes:
- dist:/code/dist
graphql:
image: docker-registry.crim.ca/geoimagenet/graphql:0.2.4
container_name: graphql
environment:
- ML_ENDPOINT=http://ml:3000
- MAGPIE_ENDPOINT=http://magpie:2001
# this raw model storage path is used as absolute path when posting models from graphql to ml
# it MUST stay the same between graphql and ml or the model creation will break
- RAW_MODEL_STORAGE_PATH=${RAW_MODEL_STORAGE_PATH}
- GEOIMAGENET_API_URL=https://${HOST_FQDN}/api/v1
volumes:
- ml_models:${RAW_MODEL_STORAGE_PATH}
api:
image: &annotation_api_image docker-registry.crim.ca/geoimagenet/api:1.4.2
container_name: api
command:
[
"gunicorn",
"--config",
"/code/gunicorn.py",
"geoimagenet_api:application",
]
volumes:
- ./config/api/gunicorn.py:/code/gunicorn.py
depends_on:
- migrations
environment:
- GEOIMAGENET_API_POSTGIS_DB=${POSTGIS_DB}
- GEOIMAGENET_API_POSTGIS_HOST=postgis
- GEOIMAGENET_API_POSTGIS_USER=${POSTGIS_USER}
- GEOIMAGENET_API_POSTGIS_PASSWORD=${POSTGIS_PASSWORD}
- GEOIMAGENET_API_MAGPIE_URL=https://${HOST_FQDN}/magpie
- GEOIMAGENET_API_BATCH_CREATION_URL=https://${HOST_FQDN}/ml/processes/batch-creation/jobs
- GEOIMAGENET_API_MAGPIE_VERIFY_SSL=true
- GEOIMAGENET_API_ALLOW_CORS=false
- GEOIMAGENET_API_SENTRY_URL=${GEOIMAGENET_API_SENTRY_URL}
restart: unless-stopped
geoserver_setup:
image: *annotation_api_image
container_name: geoserver_setup
entrypoint: ["geoserver_setup"]
depends_on:
- postgis
- geoserver
volumes:
- image_data:/nas
- ./config/api/geoserver_config.yaml:/code/geoimagenet_api/geoserver_setup/config.yaml
environment:
- GEOIMAGENET_API_GS_MIRROR_URL=http://geoserver:8080/geoserver
- GEOIMAGENET_API_GS_MIRROR_USER=admin
- GEOIMAGENET_API_GS_MIRROR_PASSWORD=${GEOIMAGENET_API_GS_MIRROR_PASSWORD}
- GEOIMAGENET_API_GS_DATASTORE_URL=${GEOIMAGENET_API_GS_DATASTORE_URL}
- GEOIMAGENET_API_GS_DATASTORE_USER=admin
- GEOIMAGENET_API_GS_DATASTORE_PASSWORD=${GEOIMAGENET_API_GS_DATASTORE_PASSWORD}
- GEOIMAGENET_API_POSTGIS_DB=${POSTGIS_DB}
- GEOIMAGENET_API_POSTGIS_HOST=postgis
- GEOIMAGENET_API_POSTGIS_USER=${POSTGIS_USER}
- GEOIMAGENET_API_POSTGIS_PASSWORD=${POSTGIS_PASSWORD}
- GEOIMAGENET_API_SENTRY_URL=${GEOIMAGENET_API_SENTRY_URL}
migrations:
image: *annotation_api_image
container_name: migrations
entrypoint: ["migrate"]
command: ["upgrade", "head"]
depends_on:
- postgis
environment:
- GEOIMAGENET_API_WAIT_FOR_DB_CONNECTION_ON_IMPORT=true
- GEOIMAGENET_API_POSTGIS_DB=${POSTGIS_DB}
- GEOIMAGENET_API_POSTGIS_HOST=postgis
- GEOIMAGENET_API_POSTGIS_USER=${POSTGIS_USER}
- GEOIMAGENET_API_POSTGIS_PASSWORD=${POSTGIS_PASSWORD}
- GEOIMAGENET_API_SENTRY_URL=${GEOIMAGENET_API_SENTRY_URL}
ml:
image: docker-registry.crim.ca/geoimagenet/ml:2.2.1
container_name: ml
volumes:
# models, datasets and jobs to be mounted to preserve them across image deployments
# NOTE:
# if destination values are modified, they must also be updated in the 'ml.ini' config
# in the docker image to reflect the changes in the settings, where values are retrieved
- ml_datasets:/data/geoimagenet/datasets
# this raw model storage path is used as absolute path when posting models from graphql to ml
# it MUST stay the same between graphql and ml or the model creation will break
- ml_models:${RAW_MODEL_STORAGE_PATH}
- ml_jobs:/data/geoimagenet/jobs
# images location for patch extraction
- image_data:/data/geoimagenet/images
depends_on:
- mongodb
links:
- mongodb
environment:
- GEOIMAGENET_ML_API_URL=https://${HOST_FQDN}/ml
- MAGPIE_USER_URL=http://magpie:2001/users/current
env_file:
- ./config/mongodb/credentials.env
restart: unless-stopped
nginx:
image: pavics/canarieapi:0.4.3
container_name: nginx
ports:
- "80:80"
- "443:443"
depends_on:
- api
- ml
- frontend
- geoserver
- twitcher
- magpie
volumes:
- ./static/pdf:/public/pdf
- ./config/nginx/conf.d:/etc/nginx/conf.d
- ./config/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./config/canarie-api/canarie_api_config.py:/config/canarie_api_config.py
- ./config/canarie-api/doc.html:/opt/local/src/CanarieAPI/canarieapi/static/doc.html
- ./config/canarie-api/res:/opt/local/src/CanarieAPI/canarieapi/static/res
- ./config/canarie-api/res/static/background.jpg:/opt/local/src/CanarieAPI/canarieapi/static/background.jpg
- ./config/canarie-api/res/static/favicon.ico:/opt/local/src/CanarieAPI/canarieapi/static/favicon.ico
- ./config/canarie-api/res/static/style.css:/opt/local/src/CanarieAPI/canarieapi/static/style.css
- ./config/canarie-api/res/templates/layout.html:/opt/local/src/CanarieAPI/canarieapi/templates/layout.html
- ${SSL_CERTIFICATE}:/etc/nginx/cert.pem
- ${SSL_PRIVATE_KEY}:/etc/nginx/privkey.pem
- dist:/public
environment:
CANARIE_API_CONFIG_FN: /config/canarie_api_config.py
healthcheck:
test: curl --insecure --fail -s -L https://localhost/canarie || exit 1
interval: 1m30s
timeout: 10s
retries: 3
restart: always
postgis:
image: kartoza/postgis:9.6-2.4
container_name: postgis
volumes:
- postgis_data:/var/lib/postgresql
- postgis_backups:/backups
environment:
- POSTGRES_DB=${POSTGIS_DB}
- POSTGRES_USER=${POSTGIS_USER}
- POSTGRES_PASS=${POSTGIS_PASSWORD}
# - ALLOW_IP_RANGE=0.0.0.0/0
# Use docker-compose.override.yml to open ports as required
# ports:
# - "5432:5432"
restart: unless-stopped
healthcheck:
test: "exit 0"
postgis_backups:
image: kartoza/pg-backup:9.6
container_name: postgis_backups
volumes:
- postgis_backups:/backups
- ./config/postgres/start_ext.sh:/start_ext.sh
depends_on:
- postgis
environment:
- HOSTNAME=${HOST_FQDN}
- DUMPPREFIX=geoimagenet
- PGUSER=${POSTGIS_USER}
- PGPASSWORD=${POSTGIS_PASSWORD}
- PGDATABASE=${POSTGIS_DB}
- PGPORT=${POSTGIS_PORT}
- PGHOST=postgis
command: "/start_ext.sh"
restart: unless-stopped
geoserver:
image: docker-registry.crim.ca/geoimagenet/geoserver:2.14.0
container_name: geoserver
# ports:
# - "8600:8080"
environment:
- >-
JAVA_OPTS=-Djava.awt.headless=true -server -Xms2G -Xmx10G -Xrs -XX:PerfDataSamplingInterval=500
-Dorg.geotools.referencing.forceXY=true -XX:SoftRefLRUPolicyMSPerMB=36000 -XX:+UseParallelGC
-XX:NewRatio=2 -XX:+CMSClassUnloadingEnabled -Dfile.encoding=UTF8 -Duser.timezone=GMT
-Djavax.servlet.request.encoding=UTF-8 -Djavax.servlet.response.encoding=UTF-8
-Duser.timezone=GMT -Dorg.geotools.shapefile.datetime=true
- >-
GEOSERVER_OPTS=-Djava.awt.headless=true -server -Xms2G -Xmx10G -Xrs -XX:PerfDataSamplingInterval=500
-Dorg.geotools.referencing.forceXY=true -XX:SoftRefLRUPolicyMSPerMB=36000 -XX:+UseParallelGC
-XX:NewRatio=2 -XX:+CMSClassUnloadingEnabled -Dfile.encoding=UTF8 -Duser.timezone=GMT
-Djavax.servlet.request.encoding=UTF-8 -Djavax.servlet.response.encoding=UTF-8
-Duser.timezone=GMT -Dorg.geotools.shapefile.datetime=true
volumes:
- geoserver_data:/opt/geoserver/data_dir
- ./config/geoserver/styles/annotations.css:/opt/geoserver/data_dir/styles/annotations.css
- ./config/geoserver/styles/annotations.xml:/opt/geoserver/data_dir/styles/annotations.xml
- ./config/geoserver/web.xml:/usr/local/tomcat/conf/web.xml
# This config makes GeoServer completely open and public
# - ./config/geoserver/config.xml:/opt/geoserver/data_dir/security/config.xml
env_file:
- config/geoserver/docker-env/geoserver.env
depends_on:
- postgis
restart: on-failure
healthcheck:
test: curl --fail -s http://localhost:8080/ || exit 1
interval: 1m30s
timeout: 10s
retries: 3
mongodb:
image: mongo:3.4.0
container_name: mongodb
volumes:
- mongodb_data:/data/db
# Mongodb crash with permission denied errors if the command is not overridden like this
command: bash -c 'chown -R mongodb:mongodb /data && chmod -R 755 /data && mongod'
restart: always
mongodb_backup:
# https://github.com/stefanprodan/mgob
image: stefanprodan/mgob:0.9
container_name: mongodb_backup
environment:
- HOSTNAME=${HOST_FQDN}
volumes:
- ./config/mongodb/backup.yml:/config/geoimagenet_mongodb_backup.yml
- mongodb_backups:/storage
- mongodb_data:/data
- /tmp:/tmp
depends_on:
- mongodb
links:
- mongodb
restart: unless-stopped
magpie:
image: pavics/magpie:1.6.0
container_name: magpie
# Use docker-compose.override.yml to open ports as required
# ports:
# - "2001:2001"
env_file:
- ./config/postgres/credentials.env
- ./config/magpie/magpie.env
environment:
HOSTNAME: $HOST_FQDN
FORWARDED_ALLOW_IPS: "*"
depends_on:
- postgis
links:
- postgis
volumes:
- ./config/magpie/permissions.cfg:/opt/local/src/magpie/config/permissions.cfg
- ./config/magpie/providers.cfg:/opt/local/src/magpie/config/providers.cfg
- ./config/magpie/magpie.ini:/opt/local/src/magpie/config/magpie.ini
- ./config/magpie/magpie.env:/opt/local/src/magpie/env/magpie.env
- ./config/postgres/credentials.env:/opt/local/src/magpie/env/postgres.env
command: bash -c 'crond && gunicorn --paste $$MAGPIE_DIR/config/magpie.ini'
restart: always
twitcher:
image: pavics/twitcher:magpie-1.6.0
container_name: twitcher
# Use docker-compose.override.yml to open ports as required
# ports:
# - "5000:5000"
# - "2002:8083"
depends_on:
- postgis
- magpie
links:
- postgis
env_file:
- ./config/postgres/credentials.env
- ./config/magpie/magpie.env
volumes:
- ./config/twitcher/twitcher.ini:/opt/birdhouse/src/twitcher/twitcher.ini
command: gunicorn --paste /opt/birdhouse/src/twitcher/twitcher.ini
restart: always
# TODO: use 'docker-compose.override.yml' to use real mounted volumes
volumes:
dist:
image_data:
driver: local
driver_opts:
type: none
o: bind
device: /nas
ml_datasets:
driver: local
driver_opts:
type: none
o: bind
device: /data/ml/datasets
ml_models:
driver: local
driver_opts:
type: none
o: bind
device: /data/ml/models
ml_jobs:
driver: local
driver_opts:
type: none
o: bind
device: /data/ml/jobs
postgis_data:
driver: local
driver_opts:
type: none
o: bind
device: /data/db_gis_data
postgis_backups:
driver: local
driver_opts:
type: none
o: bind
device: /data/postgis_backups
mongodb_data:
driver: local
driver_opts:
type: none
o: bind
device: /data/mongodb_persist
mongodb_backups:
driver: local
driver_opts:
type: none
o: bind
device: /data/mongodb_backups
geoserver_data:
driver: local
driver_opts:
type: none
o: bind
device: /data/geoserver/data_dir