-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
docker-compose.yml
360 lines (334 loc) · 10.7 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
# https://docs.docker.com/compose/compose-file
# https://github.com/compose-spec/compose-spec/blob/master/spec.md
# networks:
# lexbox:
# name: lexbox_default
# external: true
# default:
services:
ui-builder:
build:
context: .
dockerfile: docker/ui-builder/Dockerfile
image: lf-ui-builder
container_name: lf-ui-builder
volumes:
# share dist folder between ui and api containers
- lf-ui-dist:/data/src/dist
# for developer convenience volume map
- ./webpack.config.js:/data/webpack.config.js
- ./webpack-dev.config.js:/data/webpack-dev.config.js
- ./webpack-prd.config.js:/data/webpack-prd.config.js
- ./package.json:/data/package.json
- ./pnpm-lock.yaml:/data/pnpm-lock.yaml
# needed these volume maps so changes to typescript/scss would be reflected in running app, actually rebundled and output to dist which is then shared to the app container.
- ./src/angular-app:/data/src/angular-app
- ./src/sass:/data/src/sass
- ./src/Site/views/languageforge/theme/default/sass:/data/src/Site/views/languageforge/theme/default/sass
app:
build:
context: .
dockerfile: docker/app/Dockerfile
target: development
args:
- ENVIRONMENT=development
image: lf-app
container_name: lf-app
depends_on:
- db
- mail
- ld-api
- lfmerge
# networks:
# - default
# - lexbox
environment:
- WAIT_HOSTS=lf-db:27017, mail:25
- XDEBUG_MODE=develop,debug
- LDAPI_BASE_URL=http://ld-api:3000/api/v2/
# Uncomment this to test getting the LD project list from LexBox
# To use LexBox locally (in docker) you'll also need to uncomment the networks here and at the top of the file
- LEX_BOX_HOST=http://admin.localhost
- ENVIRONMENT=development
- WEBSITE=localhost
- DATABASE=scriptureforge
- MONGODB_CONN=mongodb://lf-db:27017
- MONGODB_AUTHSOURCE=admin
- MONGODB_USER=admin
- MONGODB_PASS=pass
- MAIL_HOST=mail
- GOOGLE_CLIENT_ID=bogus-development-token
- GOOGLE_CLIENT_SECRET=bogus-development-token
- FACEBOOK_CLIENT_ID=bogus-development-token
- FACEBOOK_CLIENT_SECRET=bogus-development-token
- REMEMBER_ME_SECRET=bogus-development-key
- LANGUAGE_DEPOT_API_TOKEN=bogus-development-token
command: ["/run-with-wait.sh"]
extra_hosts:
- "host.docker.internal:host-gateway"
- "admin.localhost:host-gateway"
volumes:
# holds things like audio files or pictures attached to words within a project
- lf-project-assets:/var/www/src/assets
# holds mercurial repos to avoid full clones/downloads on s/r projects
- lfmerge-sendreceive-data:/var/lib/languageforge/lexicon/sendreceive
# share dist folder between ui and api containers
- lf-ui-dist:/var/www/html/dist
# for developer convenience
- ./src/index.php:/var/www/src/index.php
- ./src/config.php:/var/www/src/config.php
- ./src/Api:/var/www/src/Api
- ./src/Site:/var/www/src/Site
# needed this volume mapping so changes to partials would be reflected in running app.
- ./src/angular-app:/var/www/src/angular-app
lfmerge:
build:
context: docker/lfmerge
dockerfile: Dockerfile
args:
- ENVIRONMENT=development
image: lfmerge
container_name: lfmerge
platform: linux/amd64
depends_on:
- db
- ld-api
environment:
- WAIT_HOSTS=db:27017
- ENVIRONMENT=development
- DATABASE=scriptureforge
- MONGODB_CONN=mongodb://db:27017
- MONGODB_AUTHSOURCE=admin
- LANGUAGE_DEPOT_API_TOKEN=bogus-development-token
- LANGUAGE_DEPOT_HG_USERNAME=admin
- LANGUAGE_DEPOT_TRUST_TOKEN=pass
- LFMERGE_LANGUAGE_DEPOT_HG_PUBLIC_HOSTNAME=hg.localhost
- LFMERGE_LANGUAGE_DEPOT_HG_PROTOCOL=http
- LFMERGE_LOGGING_DEST=syslog
- LFMERGE_BASE_DIR=/var/lib/languageforge/lexicon/sendreceive
- LFMERGE_WEBWORK_DIR=webwork
- LFMERGE_TEMPLATES_DIR=Templates
- LFMERGE_MONGO_HOSTNAME=db
- LFMERGE_MONGO_PORT=27017
- LFMERGE_MONGO_AUTHSOURCE=admin
- LFMERGE_MONGO_USER=admin
- LFMERGE_MONGO_PASS=pass
- LFMERGE_MONGO_MAIN_DB_NAME=scriptureforge
- LFMERGE_MONGO_DB_NAME_PREFIX=sf_
- LFMERGE_VERBOSE_PROGRESS=true
extra_hosts:
- "hg.localhost:host-gateway"
- "admin.localhost:host-gateway"
volumes:
# holds things like audio files or pictures attached to words within a project
- lf-project-assets:/var/www/src/assets
# holds mercurial repos to avoid full clones/downloads on s/r projects
- lfmerge-sendreceive-data:/var/lib/languageforge/lexicon/sendreceive
ssl:
image: caddy
container_name: lf-ssl
ports:
- 8080:80
- 443:443
restart: unless-stopped
depends_on:
- next-proxy
environment:
- APP_ADDRESS=next-proxy:80
volumes:
- lf-caddy-data:/data
- lf-caddy-config:/config
# for developer convenience
- ./docker/ssl/Caddyfile:/etc/caddy/Caddyfile
next-proxy-dev:
image: caddy
container_name: lf-next-proxy-dev
ports:
- 80:80
- 3000:3000
restart: unless-stopped
depends_on:
- app
- next-app-dev
environment:
- LEGACY_APP=app:80
- NEXT_APP=next-app-dev:3000
volumes:
# for developer convenience
- ./docker/next-app/dev/Caddyfile:/etc/caddy/Caddyfile
next-app-dev:
build:
context: next-app
dockerfile: ../docker/next-app/dev/Dockerfile
image: lf-next-app-dev
container_name: lf-next-app-dev
environment:
- API_HOST=http://app
command: pnpm run dev-w-host
volumes:
# for developer convenience
- ./next-app/src:/app/src
- ./next-app/static:/app/static
next-proxy:
build:
context: docker/next-app
dockerfile: Dockerfile.proxy
image: lf-next-proxy
container_name: lf-next-proxy
restart: unless-stopped
depends_on:
- app
- next-app
environment:
- LEGACY_APP=app:80
- NEXT_APP=next-app:3000
next-app:
build:
context: next-app
dockerfile: ../docker/next-app/Dockerfile.next-app
image: lf-next-app
container_name: lf-next-app
environment:
- API_HOST=http://app
mail:
image: juanluisbaptiste/postfix:1.0.0
container_name: lf-mail
environment:
- SMTP_SERVER=nobody.localhost
- SMTP_USERNAME=username
- SMTP_PASSWORD=password
- SERVER_HOSTNAME=nobody.localhost
command: sh -c "postconf -e 'default_transport = discard' && /run.sh"
db:
image: mongo:6
container_name: lf-db
ports:
# exposed this to host for admin tools
- 27017:27017
volumes:
- ./docker/db/init.js:/docker-entrypoint-initdb.d/init.js
- lf-mongo-data:/data/db
restart: always
environment:
- MONGO_INITDB_DATABASE=scriptureforge
- MONGO_INITDB_ROOT_USERNAME=admin
- MONGO_INITDB_ROOT_PASSWORD=pass
ld-db:
image: mariadb:10.10
container_name: ld-db
# To access the MySQL database via localhost:3306 on your dev machine (e.g., in VS Code), uncomment the "ports" config below
# Note that if you're running MySQL on your dev machine already, change the first number to something else, like 3307 and access localhost:3307
# ports:
# - 3306:3306
environment:
- MYSQL_HOST=ld-db
- MYSQL_DATABASE=testldapi
- MYSQL_DATABASE_PRIVATE=testldapipvt
- MYSQL_USER=redmine
- MYSQL_PASSWORD=not-a-secret
- MYSQL_ROOT_PASSWORD=also-not-a-secret
volumes:
- ./docker/test-ld/schemas-and-data.sql:/docker-entrypoint-initdb.d/schemas-and-data.sql
ld-api:
image: sillsdev/web-languagedepot-api
platform: linux/amd64
container_name: ld-api
depends_on:
- ld-db
environment:
- PORT=3000
- MYSQL_HOST=ld-db
- MYSQL_DATABASE=testldapi
- MYSQL_DATABASE_PRIVATE=testldapipvt
- MYSQL_USER=redmine
- MYSQL_PASSWORD=not-a-secret
- MYSQL_ROOT_PASSWORD=also-not-a-secret
- JWT_SIGNING_KEY=bogus-development-token
e2e-app:
build:
context: .
dockerfile: docker/app/Dockerfile
target: development
args:
- ENVIRONMENT=development
image: lf-e2e-app
container_name: e2e-app
depends_on:
- db
- mail
- ld-api
ports:
- 3238:80
environment:
- WAIT_HOSTS=db:27017, mail:25
- LDAPI_BASE_URL=http://ld-api:3000/api/v2/
- ENVIRONMENT=development
- WEBSITE=localhost
- DATABASE=e2e_test
- MONGODB_CONN=mongodb://db:27017
- MONGODB_AUTHSOURCE=admin
- MONGODB_USER=admin
- MONGODB_PASS=pass
- MAIL_HOST=mail
- REMEMBER_ME_SECRET=bogus-development-key
- LANGUAGE_DEPOT_API_TOKEN=bogus-development-token
- XDEBUG_MODE=develop,debug
- GOOGLE_CLIENT_ID=bogus-development-token
- GOOGLE_CLIENT_SECRET=bogus-development-token
- FACEBOOK_CLIENT_ID=bogus-development-token
- FACEBOOK_CLIENT_SECRET=bogus-development-token
command: sh -c "/wait && apache2-foreground"
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./test/e2e/utils/TestControl.php:/var/www/src/Api/Service/TestControl.php
- ./test/data:/tmp/e2e-test-data
- lf-ui-dist:/var/www/html/dist
# needed this volume mapping so changes to partials would be reflected in running app (e.g. HTML)
- ./src/angular-app:/var/www/src/angular-app
test-php:
build:
context: .
dockerfile: docker/test-php/Dockerfile
image: lf-test-php
container_name: lf-test-php
depends_on:
- db
- mail
environment:
- WAIT_HOSTS=db:27017, mail:25
- ENVIRONMENT=development
- WEBSITE=localhost.languageforge.org
- DATABASE=scriptureforge_test
- MONGODB_CONN=mongodb://db:27017
- MONGODB_AUTHSOURCE=admin
- MONGODB_USER=admin
- MONGODB_PASS=pass
- MAIL_HOST=mail
- LANGUAGE_DEPOT_API_TOKEN=bogus-development-token
- XDEBUG_MODE=develop,debug
# used by XDebug
extra_hosts:
- "host.docker.internal:host-gateway"
command: sh -c "/wait && /run.sh"
volumes:
# for developer convenience
- ./test:/var/www/test
- ./src/Api:/var/www/src/Api
- ./src/Site:/var/www/src/Site
composer-dev:
build:
context: .
dockerfile: docker/composer-dev/Dockerfile
image: lf-composer-dev
container_name: lf-composer-dev
volumes:
- ./src/composer.json:/work/composer.json
- ./src/composer.lock:/work/composer.lock
volumes:
lf-caddy-config:
lf-caddy-data:
lf-mongo-data:
lf-project-assets:
lfmerge-sendreceive-data:
lf-ui-dist: