-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker-compose.yml
278 lines (258 loc) · 7.56 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
version: '3.7'
# Settings and configurations that are common for all minio containers
x-minio-common: &minio-common
image: quay.io/minio/minio:RELEASE.2022-01-25T19-56-04Z
command: server --console-address ":9001" http://minio{1...4}/data
restart: unless-stopped
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
networks:
- clowder2
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ]
interval: 30s
timeout: 20s
retries: 3
services:
traefik:
image: traefik:v2.5
restart: unless-stopped
command:
- --api.insecure=true
- --providers.docker
# - --entryPoints.web.address=:80
ports:
# The HTTP port
- "80:80"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
networks:
- clowder2
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
backend:
image: 'clowder/clowder2-backend:2.0.0-beta.3'
restart: unless-stopped
build:
context: ./backend
networks:
- clowder2
environment:
MONGODB_URL: mongodb://mongo:27017
MINIO_SERVER_URL: minio-nginx:9000
MINIO_EXTERNAL_SERVER_URL: minio-nginx:9000
RABBITMQ_HOST: ${RABBITMQ_HOST:-rabbitmq}
RABBITMQ_USER: ${RABBITMQ_USER:-guest}
RABBITMQ_PASS: ${RABBITMQ_PASS:-guest}
API_HOST: ${API_HOST:-http://backend}
elasticsearch_url: http://elasticsearch:9200
auth_base: http://localhost
auth_realm: clowder
auth_client_id: clowder2-backend
auth_redirect_uri: http://localhost:80/api/v2/auth
auth_url: http://localhost/keycloak/realms/clowder/protocol/openid-connect/auth?client_id=clowder2-backend&response_type=code
oauth2_scheme_auth_url: http://keycloak:8080/keycloak/realms/clowder/protocol/openid-connect/auth?client_id=clowder2-backend&response_type=code
auth_register_url: http://localhost/keycloak/realms/clowder/protocol/openid-connect/registrations?client_id=clowder2-backend&response_type=code&redirect_uri=http://localhost:80/api/v2/auth&scope=openid%20email
auth_token_url: http://keycloak:8080/keycloak/realms/clowder/protocol/openid-connect/token
auth_server_url: http://keycloak:8080/keycloak/
keycloak_base: http://localhost/api
frontend_url: http://localhost
depends_on:
mongo:
condition: service_started
minio-nginx:
condition: service_started
keycloak:
condition: service_started
elasticsearch:
condition: service_healthy
rabbitmq:
condition: service_started
labels:
- "traefik.enable=true"
- "traefik.http.routers.backend.rule=PathPrefix(`/api`)"
- "traefik.http.routers.swagger.rule=PathPrefix(`/docs`)"
- "traefik.http.services.backend.loadbalancer.server.port=80"
- "traefik.http.routers.backend.priority=5"
frontend:
image: "clowder/clowder2-frontend:2.0.0-beta.3"
restart: unless-stopped
build:
context: ./frontend
networks:
- clowder2
depends_on:
- backend
environment:
NODE_ENV: production
CLOWDER_REMOTE_HOSTNAME: ${CLOWDER_REMOTE_HOSTNAME:-http://localhost}
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.rule=PathPrefix(`/`)"
- "traefik.http.services.frontend.loadbalancer.server.port=80"
- "traefik.http.routers.frontend.priority=1"
extractors-heartbeat:
image: "clowder/clowder2-heartbeat:main"
build:
context: backend
dockerfile: heartbeat.Dockerfile
networks:
- clowder2
restart: unless-stopped
environment:
MONGODB_URL: mongodb://mongo:27017
RABBITMQ_HOST: ${RABBITMQ_HOST:-rabbitmq}
RABBITMQ_USER: ${RABBITMQ_USER:-guest}
RABBITMQ_PASS: ${RABBITMQ_PASS:-guest}
depends_on:
- mongo
- rabbitmq
extractors-messages:
image: "clowder/clowder2-messages:main"
build:
context: backend
dockerfile: messages.Dockerfile
environment:
MONGODB_URL: mongodb://mongo:27017
RABBITMQ_HOST: ${RABBITMQ_HOST:-rabbitmq}
RABBITMQ_USER: ${RABBITMQ_USER:-guest}
RABBITMQ_PASS: ${RABBITMQ_PASS:-guest}
networks:
- clowder2
restart: unless-stopped
depends_on:
- mongo
- rabbitmq
mongo:
image: mongo:5.0
restart: unless-stopped
networks:
- clowder2
volumes:
- mongo:/data/db
# environment:
# MONGO_INITDB_ROOT_USERNAME: root
# MONGO_INITDB_ROOT_PASSWORD: example
minio1:
<<: *minio-common
hostname: minio1
volumes:
- data1:/data
minio2:
<<: *minio-common
hostname: minio2
volumes:
- data2:/data
minio3:
<<: *minio-common
hostname: minio3
volumes:
- data3:/data
minio4:
<<: *minio-common
hostname: minio4
volumes:
- data4:/data
minio-nginx:
image: nginx:1.19.2-alpine
restart: unless-stopped
hostname: nginx
networks:
- clowder2
volumes:
- ./deployments/docker/minio-nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- minio1
- minio2
- minio3
- minio4
postgres:
image: postgres
restart: unless-stopped
networks:
- clowder2
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: keycloak_prod
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: password
keycloak:
image: quay.io/keycloak/keycloak:20.0
restart: unless-stopped
networks:
- clowder2
volumes:
- ./scripts/keycloak/clowder-realm-prod.json:/opt/keycloak/data/import/realm.json:ro
- ./scripts/keycloak/clowder-theme/:/opt/keycloak/themes/clowder-theme/:ro
command:
- start-dev
- --http-relative-path /keycloak
- --import-realm
environment:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
KC_DB: postgres
KC_DB_URL_HOST: postgres
KC_DB_URL_DATABASE: keycloak_prod
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: password
depends_on:
- postgres
labels:
- "traefik.enable=true"
- "traefik.http.routers.keycloak.rule=PathPrefix(`/keycloak`)"
- "traefik.http.services.keycloak.loadbalancer.server.port=8080"
- "traefik.http.routers.keycloak.priority=10"
# message broker
rabbitmq:
image: rabbitmq:3-management-alpine
environment:
- RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbitmq_management path_prefix "/rabbitmq"
- RABBITMQ_DEFAULT_USER=${RABBITMQ_USER:-guest}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_PASS:-guest}
expose:
- 5672
- 15672
# TODO remove
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: [ "CMD", "nc", "-z", "localhost", "5672" ]
interval: 3s
timeout: 10s
retries: 3
networks:
- clowder2
volumes:
- rabbitmq:/var/lib/rabbitmq
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.3.3
restart: unless-stopped
healthcheck:
test: "curl -f http://localhost:9200/_cluster/health?wait_for_status=yellow"
networks:
- clowder2
environment:
- "cluster.name=clowder2"
- "discovery.type=single-node"
- "xpack.security.enabled=false"
- "xpack.security.http.ssl.enabled=false"
volumes:
- elasticsearch:/usr/share/elasticsearch/data
## By default this config uses default local driver,
## For custom volumes replace with volume driver configuration.
volumes:
mongo:
data1:
data2:
data3:
data4:
postgres_data:
elasticsearch:
rabbitmq:
networks:
clowder2: