-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdocker-compose.yml
287 lines (268 loc) · 9.65 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
version: '2.4'
x-mastermind-environment:
&default-mastermind-env
- GLOBAL_SECRET_KEY=${GLOBAL_SECRET_KEY}
- POSTGRESQL_HOST=waldur-db
- POSTGRESQL_PASSWORD=${POSTGRESQL_PASSWORD}
- RABBITMQ_HOST=waldur-queue
- RABBITMQ_PASSWORD=${RABBITMQ_PASSWORD}
- RABBITMQ_USERNAME=${RABBITMQ_USERNAME}
- GLOBAL_DEFAULT_FROM_EMAIL=${GLOBAL_DEFAULT_FROM_EMAIL}
- SENTRY_DSN=${SENTRY_DSN}
- GLOBAL_DEBUG=${GLOBAL_DEBUG}
- KEYCLOAK_SECRET=${KEYCLOAK_SECRET}
- SENTRY_ENVIRONMENT=${SENTRY_ENVIRONMENT}
x-mastermind-volumes:
&default-mastermind-volumes
- ${CONFIG_FOLDER}/waldur-mastermind/override.conf.py:/etc/waldur/override.conf.py
- ${CONFIG_FOLDER}/waldur-mastermind/logging.conf.py:/etc/waldur/logging.conf.py
- ${CONFIG_FOLDER}/waldur-mastermind/beat:/usr/local/bin/beat
- ${CONFIG_FOLDER}/waldur-mastermind/worker:/usr/local/bin/worker
- ${CONFIG_FOLDER}/waldur-mastermind/saml2.conf.py:/etc/waldur/saml2.conf.py
- ${CONFIG_FOLDER}/waldur-mastermind/id_rsa:/etc/waldur/id_rsa
- ${CONFIG_FOLDER}/waldur-mastermind/id_rsa.pub:/etc/waldur/id_rsa.pub
- ${CONFIG_FOLDER}/waldur-mastermind/saml2/credentials:/etc/waldur/saml2/credentials
- ${CONFIG_FOLDER}/waldur-mastermind/saml2/metadata:/etc/waldur/saml2/metadata
- ${CONFIG_FOLDER}/waldur-mastermind/valimo:/etc/waldur/valimo
- ${CONFIG_FOLDER}/waldur-mastermind/notification-templates.yaml:/etc/waldur/notification-templates.yaml
- ${CONFIG_FOLDER}/waldur-mastermind/auth.yaml:/etc/waldur/auth.yaml
- ${CONFIG_FOLDER}/waldur-mastermind/support.yaml:/etc/waldur/support.yaml
- ${CONFIG_FOLDER}/waldur-mastermind/whitelabeling.yaml:/etc/waldur/whitelabeling.yaml
- ${CONFIG_FOLDER}/waldur-mastermind/marketplace.yaml:/etc/waldur/marketplace.yaml
- ${CONFIG_FOLDER}/waldur-mastermind/marketplace-script.yaml:/etc/waldur/marketplace-script.yaml
- ${CONFIG_FOLDER}/whitelabeling:/etc/waldur/icons
- ${LIB_FOLDER}:/var/lib/waldur
- /var/run/docker.sock:/var/run/docker.sock
- /opt/waldur-script-launchzone:/opt/waldur-script-launchzone
x-mastermind-hosts:
&default-mastermind-hosts
- ${EXTRA_HOST}
services:
# PostgreSQL
waldur-db:
container_name: waldur-db
image: '${DOCKER_REGISTRY_PREFIX}library/postgres:${WALDUR_POSTGRES_IMAGE_TAG}'
user: root
environment:
- POSTGRES_USER=waldur
- POSTGRES_PASSWORD=${POSTGRESQL_PASSWORD}
- POSTGRES_DB=waldur
- POSTGRES_HOST_AUTH_METHOD=scram-sha-256
- POSTGRES_INITDB_ARGS=--auth-host=scram-sha-256
volumes:
- "./pgsql:/var/lib/postgresql/data"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U waldur"]
interval: 30s
timeout: 30s
retries: 3
restart: always
# Create celery_results database in waldur-db
create-celery-results-db:
image: '${DOCKER_REGISTRY_PREFIX}library/postgres:${WALDUR_POSTGRES_IMAGE_TAG}'
command: ["sh", "-c", "createdb -h waldur-db --no-password celery_results || true"]
environment:
- PGUSER=waldur
- PGPASSWORD=${POSTGRESQL_PASSWORD}
depends_on:
waldur-db:
condition: service_healthy
# RabbitMQ
waldur-queue:
container_name: waldur-queue
image: '${DOCKER_REGISTRY_PREFIX}bitnami/rabbitmq:4.0.2-debian-12-r0'
environment:
- RABBITMQ_USERNAME=${RABBITMQ_USERNAME}
- RABBITMQ_PASSWORD=${RABBITMQ_PASSWORD}
command: "/bin/bash -c \"rabbitmq-plugins enable --offline rabbitmq_mqtt rabbitmq_web_mqtt rabbitmq_management; /opt/bitnami/scripts/rabbitmq/run.sh\""
volumes:
- ${CONFIG_FOLDER}/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf
restart: always
# DB migration
waldur-mastermind-db-migration:
container_name: waldur-mastermind-db-migration
image: '${DOCKER_REGISTRY_PREFIX}opennode/waldur-mastermind:${WALDUR_MASTERMIND_IMAGE_TAG}'
environment: *default-mastermind-env
volumes: *default-mastermind-volumes
depends_on:
waldur-db:
condition: service_healthy
waldur-queue:
condition: service_started
command: initdb
# Whitelabeling initialization
waldur-mastermind-whitelabeling-init:
container_name: waldur-mastermind-whitelabeling-init
image: '${DOCKER_REGISTRY_PREFIX}opennode/waldur-mastermind:${WALDUR_MASTERMIND_IMAGE_TAG}'
environment: *default-mastermind-env
volumes: *default-mastermind-volumes
depends_on:
waldur-db:
condition: service_healthy
command: init-whitelabeling
# Celery
waldur-mastermind-worker:
container_name: waldur-mastermind-worker
image: '${DOCKER_REGISTRY_PREFIX}opennode/waldur-mastermind:${WALDUR_MASTERMIND_IMAGE_TAG}'
environment: *default-mastermind-env
volumes: *default-mastermind-volumes
depends_on:
waldur-db:
condition: service_healthy
waldur-queue:
condition: service_started
create-celery-results-db:
condition: service_completed_successfully
healthcheck:
test: ["CMD-SHELL", "celery -A waldur_core.server inspect ping"]
interval: 30s
timeout: 30s
retries: 3
command: worker
restart: always
extra_hosts: *default-mastermind-hosts
# Celery-beat
waldur-mastermind-beat:
container_name: waldur-mastermind-beat
image: '${DOCKER_REGISTRY_PREFIX}opennode/waldur-mastermind:${WALDUR_MASTERMIND_IMAGE_TAG}'
environment: *default-mastermind-env
volumes: *default-mastermind-volumes
depends_on:
waldur-db:
condition: service_healthy
waldur-mastermind-worker:
condition: service_started
command: beat
restart: always
extra_hosts: *default-mastermind-hosts
# MasterMind API
waldur-mastermind-api:
container_name: waldur-mastermind-api
image: '${DOCKER_REGISTRY_PREFIX}opennode/waldur-mastermind:${WALDUR_MASTERMIND_IMAGE_TAG}'
environment: *default-mastermind-env
volumes: *default-mastermind-volumes
depends_on:
waldur-mastermind-worker:
condition: service_started
waldur-mastermind-beat:
condition: service_started
waldur-db:
condition: service_healthy
waldur-queue:
condition: service_started
command: mastermind
restart: always
extra_hosts: *default-mastermind-hosts
# HomePort
waldur-homeport:
container_name: waldur-homeport
image: '${DOCKER_REGISTRY_PREFIX}opennode/waldur-homeport:${WALDUR_HOMEPORT_IMAGE_TAG}'
environment:
- API_URL=https://${WALDUR_DOMAIN:-localhost}/
- TITLE=${WALDUR_TITLE:-"Waldur | Cloud Service Management"}
volumes:
- ${CONFIG_FOLDER}/waldur-homeport/config.template.json:/usr/share/nginx/config.template.json
- ${CONFIG_FOLDER}/waldur-homeport/opt/waldur-homeport:/opt/waldur-homeport
depends_on:
waldur-db:
condition: service_healthy
waldur-mastermind-api:
condition: service_started
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail http://waldur-homeport/ || exit 1"]
interval: 30s
timeout: 30s
retries: 3
restart: always
# HTTP Router
caddy-router:
container_name: caddy
image: '${DOCKER_REGISTRY_PREFIX}library/caddy:2'
ports:
- '${WALDUR_HTTP_PORT:-80}:80'
- '${WALDUR_HTTPS_PORT:-443}:443'
environment:
- VIRTUAL_HOST=${WALDUR_DOMAIN:-localhost}
- TLS=${TLS:-"[email protected]"}
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./config/caddy-includes/:/etc/caddy-includes
- caddy_data:/data
- caddy_config:/config
depends_on:
waldur-homeport:
condition: service_healthy
restart: always
keycloak:
container_name: keycloak
image: '${DOCKER_REGISTRY_PREFIX}keycloak/keycloak:25.0'
restart: always
environment:
- KC_DB=postgres
- KC_DB_URL_HOST=keycloak-db
- KC_DB_URL_DATABASE=keycloak
- KC_DB_USERNAME=keycloak
- KC_DB_PASSWORD=${KEYCLOAK_POSTGRESQL_PASSWORD}
- KC_PROXY=edge
- KC_HOSTNAME_STRICT_HTTPS=false
- KC_HOSTNAME_STRICT=false
- KC_HTTP_ENABLED=true
- KC_HTTP_RELATIVE_PATH=/auth
- KEYCLOAK_ADMIN=admin
- KEYCLOAK_ADMIN_PASSWORD=${KEYCLOAK_ADMIN_PASSWORD}
volumes:
- ./config/keycloak/realm.json:/opt/keycloak/data/import/realm.json
- ./libraries/waldur-keycloak-mapper-1.1.2.jar:/opt/keycloak/providers/waldur-keycloak-mapper-1.1.2.jar:ro
depends_on:
- keycloak-db
command: start --import-realm
# PostgreSQL
keycloak-db:
container_name: keycloak-db
image: '${DOCKER_REGISTRY_PREFIX}library/postgres:${KEYCLOAK_POSTGRES_IMAGE_TAG}'
user: root
environment:
- POSTGRES_USER=keycloak
- POSTGRES_PASSWORD=${KEYCLOAK_POSTGRESQL_PASSWORD}
- POSTGRES_DB=keycloak
- POSTGRES_HOST_AUTH_METHOD=scram-sha-256
- POSTGRES_INITDB_ARGS=--auth-host=scram-sha-256
volumes:
- keycloak_db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U keycloak"]
interval: 30s
timeout: 30s
retries: 3
restart: always
logger:
image: '${DOCKER_REGISTRY_PREFIX}umputun/docker-logger'
container_name: "logger"
hostname: "logger"
restart: always
logging:
driver: json-file
options:
max-size: "10m"
max-file: "5"
environment:
- LOG_FILES=true
- LOG_SYSLOG=false
- MAX_FILES=10
- MAX_SIZE=50
- MAX_AGE=365
- MIX_ERR=true
- DEBUG=false
- INCLUDE=waldur-db,waldur-queue,waldur-mastermind-db-migration,waldur-mastermind-worker,waldur-mastermind-beat,waldur-mastermind-api,waldur-homeport,caddy,keycloak
volumes:
- ${LOG_FOLDER}:/srv/logs
- /var/run/docker.sock:/var/run/docker.sock
volumes:
caddy_data:
caddy_config:
keycloak_db:
networks:
default:
driver: bridge
driver_opts:
com.docker.network.driver.mtu: ${MTU:-1500}