-
-
Notifications
You must be signed in to change notification settings - Fork 53
/
docker-compose.development.yml
254 lines (241 loc) · 7.37 KB
/
docker-compose.development.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
# Copyright (c) 2022, 2023 Humanitarian OpenStreetMap Team
# This file is part of FMTM.
#
# FMTM is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# FMTM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with FMTM. If not, see <https:#www.gnu.org/licenses/>.
#
version: "3"
volumes:
fmtm_frontend:
name: fmtm-frontend-${GIT_BRANCH}
fmtm_db_data:
name: fmtm-db-data-${GIT_BRANCH}
fmtm_data:
name: fmtm-s3-data-${GIT_BRANCH}
fmtm_logs:
name: fmtm-logs-${GIT_BRANCH}
fmtm_images:
name: fmtm-images-${GIT_BRANCH}
fmtm_tiles:
name: fmtm-tiles-${GIT_BRANCH}
certs:
name: fmtm-certs-${GIT_BRANCH}
certbot_data:
name: fmtm-certbot-data-${GIT_BRANCH}
central_db_data:
name: fmtm-central-db-data-${GIT_BRANCH}
central_frontend:
name: fmtm-central-frontend-${GIT_BRANCH}
networks:
fmtm-net:
name: fmtm-${GIT_BRANCH}
services:
proxy:
image: "ghcr.io/hotosm/fmtm/proxy:${GIT_BRANCH}"
container_name: fmtm-${GIT_BRANCH}
depends_on:
api:
condition: service_started
central:
condition: service_started
central-ui:
condition: service_completed_successfully
s3:
condition: service_started
certbot:
condition: service_completed_successfully
ui:
condition: service_completed_successfully
volumes:
- fmtm_frontend:/usr/share/nginx/html/fmtm/
- central_frontend:/usr/share/nginx/html/central/
- certs:/etc/letsencrypt
- certbot_data:/var/www/certbot
environment:
FMTM_DOMAIN: ${FMTM_DOMAIN}
FMTM_API_DOMAIN: ${FMTM_API_DOMAIN:-api.${FMTM_DOMAIN}}
FMTM_ODK_DOMAIN: ${FMTM_ODK_DOMAIN:-odk.${FMTM_DOMAIN}}
FMTM_S3_DOMAIN: ${FMTM_S3_DOMAIN:-s3.${FMTM_DOMAIN}}
FMTM_SCRIPT_DOMAIN: ${FMTM_SCRIPT_DOMAIN:-_}
ports:
- 80:80
- 443:443
networks:
- fmtm-net
restart: "unless-stopped"
api:
image: "ghcr.io/hotosm/fmtm/backend:${GIT_BRANCH}"
container_name: fmtm-api-${GIT_BRANCH}
volumes:
- fmtm_logs:/opt/logs
- fmtm_tiles:/opt/tiles
depends_on:
fmtm-db:
condition: service_healthy
migrations:
condition: service_completed_successfully
s3:
condition: service_started
env_file:
- .env
networks:
- fmtm-net
restart: "unless-stopped"
ui:
# This service simply builds the frontend to a volume
# accessible to the proxy, then shuts down
image: "ghcr.io/hotosm/fmtm/frontend:${GIT_BRANCH:-development}"
build:
context: src/frontend
dockerfile: prod.dockerfile
args:
APP_VERSION: ${GIT_BRANCH}
VITE_API_URL: https://${FMTM_API_DOMAIN:-api.${FMTM_DOMAIN}}
container_name: fmtm-ui-${GIT_BRANCH}
volumes:
- fmtm_frontend:/frontend
network_mode: none
restart: "on-failure:2"
central:
image: "ghcr.io/hotosm/fmtm/odkcentral:${ODK_CENTRAL_TAG:-v2023.4.0}"
container_name: fmtm-central-${GIT_BRANCH}
depends_on:
central-db:
condition: service_healthy
environment:
- DOMAIN=local
- SYSADMIN_EMAIL=${ODK_CENTRAL_USER}
- SYSADMIN_PASSWD=${ODK_CENTRAL_PASSWD}
- HTTPS_PORT=443
- DB_HOST=${CENTRAL_DB_HOST:-central-db}
- DB_USER=${CENTRAL_DB_USER}
- DB_PASSWORD=${CENTRAL_DB_PASSWORD}
- DB_NAME=${CENTRAL_DB_NAME}
- DB_SSL=null
- EMAIL_FROM=${ODK_CENTRAL_USER}
- EMAIL_HOST=${EMAIL_HOST:-mail}
- EMAIL_PORT=${EMAIL_PORT:-25}
- EMAIL_SECURE=${EMAIL_SECURE:-false}
- EMAIL_IGNORE_TLS=${EMAIL_IGNORE_TLS:-true}
- EMAIL_USER=${EMAIL_USER:-''}
- EMAIL_PASSWORD=${EMAIL_PASSWORD:-''}
- OIDC_ENABLED=${OIDC_ENABLED:-false}
- SENTRY_ORG_SUBDOMAIN=${SENTRY_ORG_SUBDOMAIN:-o130137}
- SENTRY_KEY=${SENTRY_KEY:-3cf75f54983e473da6bd07daddf0d2ee}
- SENTRY_PROJECT=${SENTRY_PROJECT:-1298632}
networks:
- fmtm-net
restart: "unless-stopped"
central-ui:
# This service simply builds the frontend to a volume
# accessible to the proxy, then shuts down
image: "ghcr.io/hotosm/fmtm/odkcentral-ui:${ODK_CENTRAL_TAG:-v2023.4.0}"
container_name: fmtm-central-ui-${GIT_BRANCH}
volumes:
- central_frontend:/frontend
network_mode: none
restart: "on-failure:2"
s3:
image: "docker.io/minio/minio:${MINIO_TAG:-RELEASE.2023-10-25T06-33-25Z}"
container_name: fmtm-s3-${GIT_BRANCH}
environment:
MINIO_ROOT_USER: ${S3_ACCESS_KEY}
MINIO_ROOT_PASSWORD: ${S3_SECRET_KEY}
MINIO_VOLUMES: "/mnt/data"
MINIO_BROWSER: "off"
# MINIO_CONSOLE_ADDRESS: ":9090"
volumes:
- fmtm_data:/mnt/data
networks:
- fmtm-net
command: minio server
restart: "unless-stopped"
healthcheck:
test: curl --fail http://localhost:9000/minio/health/live || exit 1
start_period: 5s
interval: 5s
timeout: 5s
retries: 3
fmtm-db:
image: "postgis/postgis:${POSTGIS_TAG:-14-3.4-alpine}"
container_name: fmtm-db-${GIT_BRANCH}
volumes:
- fmtm_db_data:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=${FMTM_DB_USER}
- POSTGRES_PASSWORD=${FMTM_DB_PASSWORD}
- POSTGRES_DB=${FMTM_DB_NAME}
ports:
- "5433:5432"
networks:
- fmtm-net
restart: "unless-stopped"
healthcheck:
test: pg_isready -U ${FMTM_DB_USER} -d ${FMTM_DB_NAME}
start_period: 5s
interval: 10s
timeout: 5s
retries: 3
central-db:
image: "postgis/postgis:${POSTGIS_TAG:-14-3.4-alpine}"
container_name: fmtm-central-db-${GIT_BRANCH}
volumes:
- central_db_data:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=${CENTRAL_DB_USER}
- POSTGRES_PASSWORD=${CENTRAL_DB_PASSWORD}
- POSTGRES_DB=${CENTRAL_DB_NAME}
ports:
- "5434:5432"
networks:
- fmtm-net
restart: "unless-stopped"
healthcheck:
test: pg_isready -U ${CENTRAL_DB_USER} -d ${CENTRAL_DB_NAME}
start_period: 5s
interval: 10s
timeout: 5s
retries: 3
migrations:
image: "ghcr.io/hotosm/fmtm/backend:${GIT_BRANCH}"
container_name: fmtm-migrations-${GIT_BRANCH}
depends_on:
fmtm-db:
condition: service_healthy
s3:
condition: service_healthy
env_file:
- .env
networks:
- fmtm-net
entrypoint: ["/migrate-entrypoint.sh"]
restart: "on-failure:3"
certbot:
image: "ghcr.io/hotosm/fmtm/proxy:certs-init-development"
container_name: fmtm-cert-renew-${GIT_BRANCH}
volumes:
- certs:/etc/letsencrypt
- certbot_data:/var/www/certbot
environment:
FMTM_DOMAIN: ${FMTM_DOMAIN}
FMTM_API_DOMAIN: ${FMTM_API_DOMAIN:-api.${FMTM_DOMAIN}}
FMTM_ODK_DOMAIN: ${FMTM_ODK_DOMAIN:-odk.${FMTM_DOMAIN}}
FMTM_S3_DOMAIN: ${FMTM_S3_DOMAIN:-s3.${FMTM_DOMAIN}}
FMTM_SCRIPT_DOMAIN: ${FMTM_SCRIPT_DOMAIN:-_}
CERT_EMAIL: ${CERT_EMAIL}
ports:
- 80:80
- 443:443
networks:
- fmtm-net
restart: "on-failure:2"