forked from workadventure/workadventure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
386 lines (372 loc) · 14 KB
/
docker-compose.yaml
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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
version: "3.6"
services:
reverse-proxy:
image: traefik:v2.8
expose:
- "8080"
ports:
- "80:80"
command:
- --api.insecure=true
- --providers.docker
- --entryPoints.web.address=:80
- --providers.docker.exposedbydefault=false
labels:
- "traefik.enable=true"
- "traefik.port=8080"
- "traefik.http.routers.traefik.rule=Host(`traefik.workadventure.localhost`)"
- "traefik.http.routers.traefik.service=api@internal"
depends_on:
- back
- front
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
default:
aliases:
- 'play.workadventure.localhost'
- 'pusher.workadventure.localhost'
- 'maps.workadventure.localhost'
- 'oidc.workadventure.localhost'
- 'map-storage.workadventure.localhost'
front:
image: thecodingmachine/nodejs:16
environment:
DEBUG_MODE: "$DEBUG_MODE"
JITSI_URL: $JITSI_URL
JITSI_PRIVATE_MODE: "$JITSI_PRIVATE_MODE"
ENABLE_FEATURE_MAP_EDITOR: "$ENABLE_FEATURE_MAP_EDITOR"
HOST: "0.0.0.0"
NODE_ENV: development
SERVER_ID: "$SERVER_ID"
PUSHER_URL: //pusher.workadventure.localhost
UPLOADER_URL: //uploader.workadventure.localhost
#ADMIN_URL: //workadventure.localhost
ICON_URL: //icon.workadventure.localhost
STARTUP_COMMAND_1: ./templater.sh
STARTUP_COMMAND_2: yarn install
STARTUP_COMMAND_3: yarn typesafe-i18n
STARTUP_COMMAND_4: cd ../libs/tailwind && yarn install
STARTUP_COMMAND_5: cd ../map-editor-types && yarn install
STUN_SERVER: "stun:stun.l.google.com:19302"
TURN_SERVER: "turn:coturn.workadventure.localhost:3478,turns:coturn.workadventure.localhost:5349"
DISABLE_NOTIFICATIONS: "$DISABLE_NOTIFICATIONS"
SKIP_RENDER_OPTIMIZATIONS: "$SKIP_RENDER_OPTIMIZATIONS"
# Use TURN_USER/TURN_PASSWORD if your Coturn server is secured via hard coded credentials.
# Advice: you should instead use Coturn REST API along the TURN_STATIC_AUTH_SECRET in the Back container
TURN_USER: ""
TURN_PASSWORD: ""
MAX_PER_GROUP: "$MAX_PER_GROUP"
MAX_USERNAME_LENGTH: "$MAX_USERNAME_LENGTH"
DISABLE_ANONYMOUS: $DISABLE_ANONYMOUS
# Note: ENABLE_OPENID needs to have any not falsy value to be enabled.
ENABLE_OPENID: "$OPID_CLIENT_ID"
OPID_PROFILE_SCREEN_PROVIDER: "$OPID_PROFILE_SCREEN_PROVIDER"
CHAT_URL: //chat.workadventure.localhost
command: yarn run start
volumes:
- ./front:/usr/src/app
- ./libs:/usr/src/libs
labels:
- "traefik.enable=true"
- "traefik.http.routers.front.rule=Host(`play.workadventure.localhost`)"
- "traefik.http.routers.front.entryPoints=web"
- "traefik.http.services.front.loadbalancer.server.port=8080"
chat:
image: thecodingmachine/nodejs:16
command: yarn run start
environment:
STARTUP_COMMAND_1: ./templater.sh
STARTUP_COMMAND_2: yarn install
STARTUP_COMMAND_3: yarn typesafe-i18n
STARTUP_COMMAND_4: cd ../libs/tailwind && yarn install
STARTUP_COMMAND_5: cd ../map-editor-types && yarn install
PUSHER_URL: //pusher.workadventure.localhost
UPLOADER_URL: //uploader.workadventure.localhost
EMBEDLY_KEY: $EMBEDLY_KEY
volumes:
- ./front/chat:/usr/src/app
- ./libs:/usr/src/libs
labels:
- "traefik.enable=true"
- "traefik.http.routers.chat.rule=Host(`chat.workadventure.localhost`)"
- "traefik.http.routers.chat.entryPoints=web"
- "traefik.http.services.chat.loadbalancer.server.port=8080"
- "traefik.http.routers.chat-ssl.rule=Host(`chat.workadventure.localhost`)"
- "traefik.http.routers.chat-ssl.entryPoints=websecure"
- "traefik.http.routers.chat-ssl.tls=true"
- "traefik.http.routers.chat-ssl.service=chat"
pusher:
image: thecodingmachine/nodejs:16
command: yarn dev
environment:
DEBUG: "socket:*"
DEBUG_ERROR_MESSAGES: "true"
# On startup, we ask the messages container to regenerate the files.
# Note: we need to use this "messages" container because of ARM64 processors that are not supported with protoc (used in "messages" container)
STARTUP_COMMAND_0: touch /usr/src/app/src/Messages/generate_request/need_regenerate
STARTUP_COMMAND_1: yarn install
# wait for files to be generated by "messages" container
STARTUP_COMMAND_2: while [ -f /usr/src/app/src/Messages/generate_request/need_regenerate ]; do sleep 1; done
SECRET_KEY: yourSecretKey
ADMIN_API_TOKEN: "$ADMIN_API_TOKEN"
API_URL: back:50051
FRONT_URL: http://play.workadventure.localhost
PUSHER_URL: http://pusher.workadventure.localhost
OPID_CLIENT_ID: $OPID_CLIENT_ID
OPID_CLIENT_SECRET: $OPID_CLIENT_SECRET
OPID_CLIENT_ISSUER: $OPID_CLIENT_ISSUER
OPID_CLIENT_REDIRECT_URL: $OPID_CLIENT_REDIRECT_URL
OPID_PROFILE_SCREEN_PROVIDER: $OPID_PROFILE_SCREEN_PROVIDER
OPID_SCOPE: $OPID_SCOPE
OPID_PROMPT: $OPID_PROMPT
OPID_USERNAME_CLAIM: $OPID_USERNAME_CLAIM
OPID_LOCALE_CLAIM: $OPID_LOCALE_CLAIM
DISABLE_ANONYMOUS: $DISABLE_ANONYMOUS
PUBLIC_MAP_STORAGE_URL: "http://map-storage.workadventure.localhost"
ENABLE_OPENAPI_ENDPOINT: "true"
START_ROOM_URL: "$START_ROOM_URL"
# Only used if you set up a JWT authentication mechanism in Ejabberd
EJABBERD_JWT_SECRET: mySecretJwtToken
EJABBERD_DOMAIN: ejabberd
EJABBERD_URI: ejabberd:5443
volumes:
- ./pusher:/usr/src/app
labels:
- "traefik.enable=true"
- "traefik.http.routers.pusher.rule=Host(`pusher.workadventure.localhost`)"
- "traefik.http.routers.pusher.entryPoints=web"
- "traefik.http.services.pusher.loadbalancer.server.port=8080"
maps:
image: thecodingmachine/php:8.1-v4-apache-node12
environment:
DEBUG_MODE: "$DEBUG_MODE"
HOST: "0.0.0.0"
NODE_ENV: development
FRONT_URL: http://play.workadventure.localhost
#APACHE_DOCUMENT_ROOT: dist/
#APACHE_EXTENSIONS: headers
#APACHE_EXTENSION_HEADERS: 1
STARTUP_COMMAND_0: sudo a2enmod headers
STARTUP_COMMAND_1: yarn install
volumes:
- ./maps:/var/www/html
labels:
- "traefik.enable=true"
- "traefik.http.routers.maps.rule=Host(`maps.workadventure.localhost`)"
- "traefik.http.routers.maps.entryPoints=web,traefik"
- "traefik.http.services.maps.loadbalancer.server.port=80"
back:
image: thecodingmachine/nodejs:16
command: yarn dev
#command: yarn run profile
environment:
DEBUG: "*"
# On startup, we ask the messages container to regenerate the files.
# Note: we need to use this "messages" container because of ARM64 processors that are not supported with protoc (used in "messages" container)
STARTUP_COMMAND_0: touch /usr/src/app/src/Messages/generate_request/need_regenerate
STARTUP_COMMAND_1: yarn install
# wait for files to be generated by "messages" container
STARTUP_COMMAND_2: while [ -f /usr/src/app/src/Messages/generate_request/need_regenerate ]; do sleep 1; done
SECRET_KEY: yourSecretKey
SECRET_JITSI_KEY: "$SECRET_JITSI_KEY"
ENABLE_FEATURE_MAP_EDITOR: "$ENABLE_FEATURE_MAP_EDITOR"
ALLOW_ARTILLERY: "true"
ADMIN_API_TOKEN: "$ADMIN_API_TOKEN"
JITSI_URL: $JITSI_URL
JITSI_ISS: $JITSI_ISS
BBB_URL: $BBB_URL
BBB_SECRET: $BBB_SECRET
TURN_STATIC_AUTH_SECRET: SomeStaticAuthSecret
MAX_PER_GROUP: "MAX_PER_GROUP"
REDIS_HOST: redis
NODE_ENV: development
STORE_VARIABLES_FOR_LOCAL_MAPS: "true"
PROMETHEUS_AUTHORIZATION_TOKEN: "$PROMETHEUS_AUTHORIZATION_TOKEN"
MAP_STORAGE_URL: "map-storage:50053"
PUBLIC_MAP_STORAGE_URL: "http://map-storage.workadventure.localhost"
PLAYER_VARIABLES_MAX_TTL: $PLAYER_VARIABLES_MAX_TTL
volumes:
- ./back:/usr/src/app
labels:
- "traefik.enable=true"
- "traefik.http.routers.back.rule=Host(`api.workadventure.localhost`)"
- "traefik.http.routers.back.entryPoints=web"
- "traefik.http.services.back.loadbalancer.server.port=8080"
map-storage:
image: thecodingmachine/nodejs:16
command: yarn start:dev
#command: yarn run profile
environment:
DEBUG: "*"
STARTUP_COMMAND_1: yarn install
# wait for files generated by "messages" container to exists
STARTUP_COMMAND_2: sleep 5; while [ ! -f /usr/src/app/src/Messages/ts-proto-nest-generated/protos/messages.ts ]; do sleep 1; done
NODE_ENV: development
PROMETHEUS_AUTHORIZATION_TOKEN: "$PROMETHEUS_AUTHORIZATION_TOKEN"
volumes:
- ./map-storage:/usr/src/app
- ./libs:/usr/src/libs
labels:
- "traefik.enable=true"
- "traefik.http.routers.map-storage.rule=Host(`map-storage.workadventure.localhost`)"
- "traefik.http.routers.map-storage.entryPoints=web"
- "traefik.http.services.map-storage.loadbalancer.server.port=3000"
uploader:
image: thecodingmachine/nodejs:16
command: yarn dev
#command: yarn run profile
environment:
DEBUG: "*"
STARTUP_COMMAND_1: yarn install
UPLOADER_URL: http://uploader.workadventure.localhost
#AWS
AWS_ACCESS_KEY_ID: "$AWS_ACCESS_KEY_ID"
AWS_SECRET_ACCESS_KEY: "$AWS_SECRET_ACCESS_KEY"
AWS_DEFAULT_REGION: "$AWS_DEFAULT_REGION"
AWS_BUCKET: "$AWS_BUCKET"
AWS_URL: "$AWS_URL"
AWS_ENDPOINT: "$AWS_ENDPOINT"
#REDIS
REDIS_HOST: "$UPLOADER_REDIS_HOST"
REDIS_PORT: "$UPLOADER_REDIS_PORT"
volumes:
- ./uploader:/usr/src/app
labels:
- "traefik.enable=true"
- "traefik.http.routers.uploader.rule=Host(`uploader.workadventure.localhost`)"
- "traefik.http.routers.uploader.entryPoints=web"
- "traefik.http.services.uploader.loadbalancer.server.port=8080"
messages:
image: thecodingmachine/workadventure-back-base:latest
environment:
#STARTUP_COMMAND_0: sudo apt-get install -y inotify-tools
STARTUP_COMMAND_1: yarn install
STARTUP_COMMAND_2: yarn run proto:watch
volumes:
- ./messages:/usr/src/app
- ./back:/usr/src/back
- ./front:/usr/src/front
- ./pusher:/usr/src/pusher
- ./map-storage:/usr/src/map-storage
redis:
image: redis:6
redisinsight:
image: redislabs/redisinsight:latest
labels:
- "traefik.enable=true"
- "traefik.http.routers.redisinsight.rule=Host(`redis.workadventure.localhost`)"
- "traefik.http.routers.redisinsight.entryPoints=web"
- "traefik.http.services.redisinsight.loadbalancer.server.port=8001"
icon:
image: matthiasluedtke/iconserver:v3.13.0
labels:
- "traefik.enable=true"
- "traefik.http.routers.icon.rule=Host(`icon.workadventure.localhost`)"
- "traefik.http.routers.icon.entryPoints=web"
- "traefik.http.services.icon.loadbalancer.server.port=8080"
ejabberd:
image: ejabberd/ecs
volumes:
- ./xmpp/ejabberd.yml:/home/ejabberd/conf/ejabberd.yml
labels:
- "traefik.enable=true"
- "traefik.http.routers.xmpp.rule=Host(`xmpp-admin.workadventure.localhost`)"
- "traefik.http.routers.xmpp.entryPoints=web"
- "traefik.http.services.xmpp.loadbalancer.server.port=5380"
# A mock server to test OpenID connect connectivity
oidc-server-mock:
image: ghcr.io/soluto/oidc-server-mock:0.7.0
environment:
ASPNETCORE_ENVIRONMENT: Development
SERVER_OPTIONS_INLINE: |
{
"AccessTokenJwtType": "JWT",
"Discovery": {
"ShowKeySet": true
},
"Authentication": {
"CookieSameSiteMode": "Lax",
"CheckSessionCookieSameSiteMode": "Lax"
}
}
LOGIN_OPTIONS_INLINE: |
{
"AllowRememberLogin": false
}
LOGOUT_OPTIONS_INLINE: |
{
"AutomaticRedirectAfterSignOut": true
}
API_SCOPES_INLINE: |
- Name: some-app-scope-1
- Name: some-app-scope-2
API_RESOURCES_INLINE: |
- Name: some-app
Scopes:
- some-app-scope-1
- some-app-scope-2
USERS_CONFIGURATION_INLINE: |
[
{
"SubjectId":"1",
"Username":"User1",
"Password":"pwd",
"Claims": [
{
"Type": "name",
"Value": "Sam Tailor"
},
{
"Type": "email",
"Value": "sam.tailor@gmail.com"
},
{
"Type": "some-api-resource-claim",
"Value": "Sam's Api Resource Custom Claim"
},
{
"Type": "some-api-scope-claim",
"Value": "Sam's Api Scope Custom Claim"
},
{
"Type": "some-identity-resource-claim",
"Value": "Sam's Identity Resource Custom Claim"
}
]
}
]
CLIENTS_CONFIGURATION_PATH: /tmp/config/clients-config.json
volumes:
- ./contrib/oidc-server-mock:/tmp/config:ro
labels:
- "traefik.enable=true"
- "traefik.http.routers.oidc.rule=Host(`oidc.workadventure.localhost`)"
- "traefik.http.routers.oidc.entryPoints=web"
healthcheck:
#disable: true
timeout: 5s
# coturn:
# image: coturn/coturn:4.5.2
# command:
# - turnserver
# #- -c=/etc/coturn/turnserver.conf
# - --log-file=stdout
# - --external-ip=$$(detect-external-ip)
# - --listening-port=3478
# - --min-port=10000
# - --max-port=10010
# - --tls-listening-port=5349
# - --listening-ip=0.0.0.0
# - --realm=coturn.workadventure.localhost
# - --server-name=coturn.workadventure.localhost
# - --lt-cred-mech
# # Enable Coturn "REST API" to validate temporary passwords.
# #- --use-auth-secret
# #- --static-auth-secret=SomeStaticAuthSecret
# #- --userdb=/var/lib/turn/turndb
# - --user=workadventure:WorkAdventure123
# # use real-valid certificate/privatekey files
# #- --cert=/root/letsencrypt/fullchain.pem
# #- --pkey=/root/letsencrypt/privkey.pem
# network_mode: host