-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
235 lines (210 loc) · 5.95 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
volumes:
ca_storage:
hub_storage:
caddy_config:
mariadb_data:
meilisearch_data:
postgres_data:
services:
# ==============
# Content Author
# ==============
contentauthor:
image: ghcr.io/cerpus/edlib-contentauthor:php-latest
depends_on:
postgres: { condition: service_healthy }
redis: { condition: service_healthy }
environment: &contentauthor-env
APP_KEY: ${CONTENTAUTHOR_APP_KEY}
APP_URL: https://${CONTENTAUTHOR_HOST:-ca.localhost}
CACHE_DRIVER: redis
DB_HOST: mariadb
DB_DATABASE: mariadb
DB_USERNAME: root
DB_PASSWORD: secret
ENABLE_EDLIB2: 'false'
H5P_CONSUMER_KEY: ${CONTENTAUTHOR_LTI_KEY:-h5p}
H5P_CONSUMER_SECRET: ${CONTENTAUTHOR_LTI_SECRET}
H5P_IS_HUB_ENABLED: 'true'
LOG_CHANNEL: stderr
LOG_STDERR_FORMATTER: 'null'
REDIS_DB: '0'
REDIS_CACHE_DB: '1'
REDIS_HOST: redis
SESSION_DRIVER: redis
healthcheck:
test: [CMD, nc, -z, localhost, '9000']
platform: linux/amd64
volumes:
- ca_storage:/app/storage
contentauthor-cron:
image: ghcr.io/cerpus/edlib-contentauthor:php-latest
command: [php, artisan, 'schedule:work']
depends_on:
contentauthor-startup: { condition: service_completed_successfully }
environment:
<<: *contentauthor-env
platform: linux/amd64
volumes:
- ca_storage:/app/storage
contentauthor-startup:
image: ghcr.io/cerpus/edlib-contentauthor:php-latest
command: [prod-startup.sh]
depends_on:
mariadb: { condition: service_healthy }
redis: { condition: service_healthy }
environment:
<<: *contentauthor-env
platform: linux/amd64
volumes:
- ca_storage:/app/storage
- ./contentauthor/startup.sh:/usr/local/bin/prod-startup.sh:ro
contentauthor-web:
image: ghcr.io/cerpus/edlib-contentauthor:web-latest
depends_on:
contentauthor: { condition: service_healthy }
environment:
PHP_FPM_HOST: contentauthor:9000
platform: linux/amd64
volumes:
- ca_storage:/app/storage:ro
contentauthor-worker:
image: ghcr.io/cerpus/edlib-contentauthor:php-latest
command: [php, artisan, 'queue:work']
depends_on:
postgres: { condition: service_healthy }
redis: { condition: service_healthy }
environment:
<<: *contentauthor-env
platform: linux/amd64
volumes:
- ca_storage:/app/storage
# ===
# Hub
# ===
hub:
image: ghcr.io/cerpus/edlib-hub:php-latest
depends_on:
hub-startup: { condition: service_completed_successfully }
environment: &hub-env
APP_KEY: ${HUB_APP_KEY}
APP_URL: https://${HUB_HOST:-hub.localhost}
CACHE_DRIVER: redis
DB_HOST: postgres
DB_DATABASE: postgres
DB_USERNAME: postgres
DB_PASSWORD: secret
MEILISEARCH_HOST: http://meilisearch:7700
MEILISEARCH_KEY: masterkey1234567
REDIS_DB: '2'
REDIS_CACHE_DB: '3'
REDIS_HOST: redis
QUEUE_CONNECTION: redis
SESSION_DRIVER: redis
healthcheck:
test: [CMD, nc, -z, localhost, '9000']
platform: linux/amd64
volumes:
- hub_storage:/app/storage
hub-cron:
image: ghcr.io/cerpus/edlib-hub:php-latest
command: [php, artisan, 'schedule:work']
depends_on:
hub-startup: { condition: service_completed_successfully }
environment:
<<: *hub-env
platform: linux/amd64
volumes:
- hub_storage:/app/storage
hub-startup:
image: ghcr.io/cerpus/edlib-hub:php-latest
command: [prod-startup.sh]
depends_on:
meilisearch: { condition: service_healthy }
postgres: { condition: service_healthy }
redis: { condition: service_healthy }
environment:
<<: *hub-env
CONTENTAUTHOR_HOST: ${CONTENTAUTHOR_HOST:-ca.localhost}
CONTENTAUTHOR_LTI_KEY: ${CONTENTAUTHOR_LTI_KEY:-h5p}
CONTENTAUTHOR_LTI_SECRET: ${CONTENTAUTHOR_LTI_SECRET}
platform: linux/amd64
volumes:
- hub_storage:/app/storage
- ./hub/startup.sh:/usr/local/bin/prod-startup.sh:ro
hub-web:
image: ghcr.io/cerpus/edlib-hub:web-latest
depends_on:
hub: { condition: service_healthy }
environment:
PHP_FPM_HOST: hub:9000
platform: linux/amd64
volumes:
- hub_storage:/app/storage:ro
hub-worker:
image: ghcr.io/cerpus/edlib-hub:php-latest
command: [php, artisan, 'queue:work']
depends_on:
hub-startup: { condition: service_completed_successfully }
environment:
<<: *hub-env
platform: linux/amd64
volumes:
- hub_storage:/app/storage
# ===
# Web
# ===
web:
image: caddy:2-alpine
depends_on:
contentauthor: { condition: service_healthy }
hub: { condition: service_healthy }
environment:
CONTENTAUTHOR_HOST: ${CONTENTAUTHOR_HOST:-ca.localhost}
HUB_HOST: ${HUB_HOST:-hub.localhost}
networks:
default:
aliases:
- ${CONTENTAUTHOR_HOST:-ca.localhost}
- ${HUB_HOST:-hub.localhost}
ports:
- 80:80
- 443:443
- 443:443/udp
volumes:
- caddy_config:/config
- ./data/caddy/data:/data
- ./caddy/Caddyfile:/etc/caddy/Caddyfile:r
# ==================
# Auxiliary services
# ==================
mariadb:
image: mariadb:11
environment:
MARIADB_ROOT_PASSWORD: secret
healthcheck:
test: [CMD, mariadb, -uroot, -psecret, "-eSELECT 1"]
volumes:
- mariadb_data:/var/lib/mysql
meilisearch:
image: getmeili/meilisearch:v1.8
environment:
MEILI_NO_ANALYTICS: 'true'
MEILI_MASTER_KEY: masterkey1234567
healthcheck:
test: [CMD, curl, -f, http://localhost:7700/health]
volumes:
- meilisearch_data:/meili_data
postgres:
image: postgres:16-alpine
healthcheck:
test: [CMD, pg_isready]
environment:
POSTGRES_PASSWORD: secret
PGUSER: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:7-alpine
healthcheck:
test: [CMD, redis-cli, ping]