-
-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
349 lines (332 loc) · 10.6 KB
/
Copy pathdocker-compose.yml
File metadata and controls
349 lines (332 loc) · 10.6 KB
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
services:
activitypub:
build:
context: .
target: dev
ports:
- "8080:8080"
- "9229:9229"
volumes:
- ./src:/opt/activitypub/src
- dev-content:/opt/activitypub/content
environment:
- PORT=8080
- MYSQL_USER=ghost
- MYSQL_PASSWORD=password
- MYSQL_HOST=mysql
- MYSQL_PORT=3306
- MYSQL_DATABASE=activitypub
- NODE_ENV=development
- ALLOW_PRIVATE_ADDRESS=true
- SKIP_SIGNATURE_VERIFICATION=true
- USE_MQ=true
- MQ_PUBSUB_PROJECT_ID=activitypub
- MQ_PUBSUB_HOST=pubsub:8085
- MQ_PUBSUB_TOPIC_NAME=fedify-topic
- MQ_PUBSUB_RETRY_TOPIC_NAME=fedify-retry-topic
- MQ_PUBSUB_USE_RETRY_TOPIC=true
- MQ_PUBSUB_MAX_DELIVERY_ATTEMPTS=5
- MQ_PUBSUB_GHOST_TOPIC_NAME=ghost-topic
- GCP_BUCKET_NAME=activitypub
- GCP_STORAGE_EMULATOR_HOST=http://fake-gcs:4443
# - GCS_LOCAL_STORAGE_HOSTING_URL=https://<tailscale-url>/.ghost/activitypub/gcs
- LOCAL_STORAGE_PATH=/opt/activitypub/content
# - LOCAL_STORAGE_HOSTING_URL=https://<tailscale-url>/.ghost/activitypub/local-storage
# - GHOST_PRO_IP_ADDRESSES=100.83.192.90,192.168.65.1
- REDIS_HOST=redis
- REDIS_PORT=6379
- FEDIFY_KV_STORE_TYPE=redis
command: pnpm build:watch
depends_on:
migrate:
condition: service_completed_successfully
mysql:
condition: service_healthy
redis:
condition: service_healthy
pubsub:
condition: service_healthy
fake-gcs:
condition: service_healthy
migrate:
build: migrate
volumes:
- ./migrate/migrations:/migrations
environment:
- MYSQL_DB=mysql://ghost:password@tcp(mysql:3306)/activitypub
depends_on:
mysql:
condition: service_healthy
nginx:
build: dev/nginx
ports:
- "80:80"
volumes:
- dev-content:/content:ro
- ./dev/fake-gcs/storage:/gcp-storage:ro
depends_on:
- activitypub
mysql:
image: mysql:8.4.11@sha256:6ea90827b1100f8f2ae306a539f86d2c264a26ed435a2a9f75551dd5c3aeb242
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_USER=ghost
- MYSQL_PASSWORD=password
- MYSQL_DATABASE=activitypub
ports:
- "3307:3306"
healthcheck:
test: "mysql -h 127.0.0.1 -ughost -ppassword activitypub -e 'select 1'"
interval: 1s
retries: 120
redis:
image: redis:7-alpine@sha256:858f009f9709ce576febc734aa78b8f6d624b82571f9ddb6bda4377c833b3499
volumes:
- ./dev/redis/start.sh:/usr/local/bin/start.sh
command: /usr/local/bin/start.sh
ports:
- "6380:6379"
healthcheck:
test: ["CMD", "redis-cli", "-p", "6379", "cluster", "info"]
interval: 1s
retries: 120
pubsub:
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:587.0.0-emulators@sha256:8d8573471c489a409f03891d2c24d177fa531276184f7002b9a2d853d1b3ed54
command: /bin/bash -c "/opt/activitypub/start-pubsub.sh"
volumes:
- ./dev/pubsub/start.sh:/opt/activitypub/start-pubsub.sh
environment:
- PROJECT_ID=activitypub
- FEDIFY_TOPIC_NAME=fedify-topic
- FEDIFY_SUBSCRIPTION_NAME=fedify-subscription
- FEDIFY_PUSH_ENDPOINT=http://activitypub:8080/.ghost/activitypub/pubsub/fedify/push
- FEDIFY_RETRY_TOPIC_NAME=fedify-retry-topic
- FEDIFY_RETRY_SUBSCRIPTION_NAME=fedify-subscription-retry
- FEDIFY_RETRY_PUSH_ENDPOINT=http://activitypub:8080/.ghost/activitypub/pubsub/fedify/push
- GHOST_TOPIC_NAME=ghost-topic
- GHOST_SUBSCRIPTION_NAME=ghost-subscription
- GHOST_PUSH_ENDPOINT=http://activitypub:8080/.ghost/activitypub/pubsub/ghost/push
healthcheck:
test: "curl -f http://localhost:8085 || exit 1"
interval: 1s
retries: 120
start_period: 5s
activitypub-testing:
networks:
- test_network
build:
context: .
target: dev
volumes:
- ./src:/opt/activitypub/src
- ./vitest.config.ts:/opt/activitypub/vitest.config.ts
- test-content:/opt/activitypub/content
environment:
- LOCAL_STORAGE_PATH=/opt/activitypub/content
- PORT=8083
- MYSQL_USER=root
- MYSQL_PASSWORD=root
- MYSQL_HOST=mysql-testing
- MYSQL_PORT=3306
- MYSQL_DATABASE=activitypub
- NODE_ENV=testing
- SKIP_SIGNATURE_VERIFICATION=true
- ALLOW_PRIVATE_ADDRESS=true
- NODE_TLS_REJECT_UNAUTHORIZED=0
- USE_MQ=true
- MQ_PUBSUB_PROJECT_ID=activitypub
- MQ_PUBSUB_HOST=pubsub-testing:8085
- MQ_PUBSUB_TOPIC_NAME=fedify-topic
- MQ_PUBSUB_RETRY_TOPIC_NAME=fedify-retry-topic
- MQ_PUBSUB_USE_RETRY_TOPIC=true
- MQ_PUBSUB_MAX_DELIVERY_ATTEMPTS=5
- MQ_PUBSUB_GHOST_TOPIC_NAME=ghost-topic
- GCP_BUCKET_NAME=activitypub
- GCS_LOCAL_STORAGE_HOSTING_URL=http://fake-gcs:4443/.ghost/activitypub/gcs
- GCP_STORAGE_EMULATOR_HOST=http://fake-gcs:4443
- REDIS_HOST=redis-testing
- REDIS_PORT=6379
- FEDIFY_KV_STORE_TYPE=redis
- JWKS_REFETCH_COOLDOWN_MS=0
command: pnpm build:watch
depends_on:
migrate-testing:
condition: service_completed_successfully
mysql-testing:
condition: service_healthy
redis-testing:
condition: service_healthy
pubsub-testing:
condition: service_healthy
fake-gcs:
condition: service_healthy
healthcheck:
test: 'if [ ! -f /tmp/health.txt ]; then (wget --spider http://0.0.0.0:8083/ping || exit 1) && touch /tmp/health.txt ; else echo "healthcheck already executed"; fi'
interval: 1s
retries: 120
start_period: 5s
migrate-testing:
networks:
- test_network
build: migrate
volumes:
- ./migrate/migrations:/migrations
environment:
- MYSQL_DB=mysql://ghost:password@tcp(mysql-testing:3306)/activitypub
depends_on:
mysql-testing:
condition: service_healthy
cucumber-tests:
networks:
- test_network
build:
context: .
target: dev
volumes:
- ./features:/opt/activitypub/features
- ./cucumber.js:/opt/activitypub/cucumber.js
environment:
- MYSQL_USER=ghost
- MYSQL_PASSWORD=password
- MYSQL_HOST=mysql-testing
- MYSQL_PORT=3306
- MYSQL_DATABASE=activitypub
- NODE_ENV=testing
- NODE_TLS_REJECT_UNAUTHORIZED=0
- GCP_BUCKET_NAME=activitypub
- GCP_STORAGE_EMULATOR_HOST=http://fake-gcs:4443
- GCS_LOCAL_STORAGE_HOSTING_URL=https://self.test/.ghost/activitypub/gcs
- TAGS
- URL_GHOST_ACTIVITY_PUB=https://self.test
- URL_EXTERNAL_ACTIVITY_PUB=https://fake-external-activitypub.test
command: /opt/activitypub/node_modules/.bin/cucumber-js
depends_on:
caddy-testing:
condition: service_started
activitypub-testing:
condition: service_healthy
mysql-testing:
networks:
- test_network
image: mysql:8.4.11@sha256:6ea90827b1100f8f2ae306a539f86d2c264a26ed435a2a9f75551dd5c3aeb242
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_USER=ghost
- MYSQL_PASSWORD=password
- MYSQL_DATABASE=activitypub
healthcheck:
test: "mysql -h 127.0.0.1 -ughost -ppassword activitypub -e 'select 1'"
interval: 1s
retries: 120
redis-testing:
networks:
- test_network
image: redis:7-alpine@sha256:858f009f9709ce576febc734aa78b8f6d624b82571f9ddb6bda4377c833b3499
volumes:
- ./dev/redis/start.sh:/usr/local/bin/start.sh
command: /usr/local/bin/start.sh
healthcheck:
test: ["CMD", "redis-cli", "-p", "6379", "cluster", "info"]
interval: 1s
retries: 120
pubsub-testing:
networks:
- test_network
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:587.0.0-emulators@sha256:8d8573471c489a409f03891d2c24d177fa531276184f7002b9a2d853d1b3ed54
command: /bin/bash -c "/opt/activitypub/start-pubsub.sh"
volumes:
- ./dev/pubsub/start.sh:/opt/activitypub/start-pubsub.sh
environment:
- PROJECT_ID=activitypub
- FEDIFY_TOPIC_NAME=fedify-topic
- FEDIFY_SUBSCRIPTION_NAME=fedify-subscription
- FEDIFY_PUSH_ENDPOINT=http://activitypub-testing:8083/.ghost/activitypub/pubsub/fedify/push
- FEDIFY_RETRY_TOPIC_NAME=fedify-retry-topic
- FEDIFY_RETRY_SUBSCRIPTION_NAME=fedify-subscription-retry
- FEDIFY_RETRY_PUSH_ENDPOINT=http://activitypub-testing:8083/.ghost/activitypub/pubsub/fedify/push
- GHOST_TOPIC_NAME=ghost-topic
- GHOST_SUBSCRIPTION_NAME=ghost-subscription
- GHOST_PUSH_ENDPOINT=http://activitypub-testing:8083/.ghost/activitypub/pubsub/ghost/push
healthcheck:
test: "curl -f http://localhost:8085 || exit 1"
interval: 1s
retries: 120
start_period: 5s
caddy-testing:
networks:
test_network:
aliases:
- self.test
- alice.test
- bob.test
- charlie.test
- fake-external-activitypub.test
image: caddy:2@sha256:0c994536bddb66445885237f1a5dcc1916bccea922661c76b4e9fc24061f9b52
ports:
- "444:443"
volumes:
- ./dev/caddy-testing/Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
environment:
- NODE_TLS_REJECT_UNAUTHORIZED=0
depends_on:
activitypub-testing:
condition: service_started
ghost-wiremock:
condition: service_started
external-wiremock:
condition: service_started
ghost-wiremock:
networks:
- test_network
image: wiremock/wiremock:3.13.2-1@sha256:8bdd64a25db911ba521a38aebf1590d96767c2d29f3e941e2f496a760bbdf47d
entrypoint:
[
"/docker-entrypoint.sh",
"--global-response-templating",
"--disable-gzip",
"--verbose",
"--port=80",
"--https-port=443",
]
external-wiremock:
networks:
- test_network
image: wiremock/wiremock:3.13.2-1@sha256:8bdd64a25db911ba521a38aebf1590d96767c2d29f3e941e2f496a760bbdf47d
entrypoint:
[
"/docker-entrypoint.sh",
"--global-response-templating",
"--disable-gzip",
"--verbose",
"--port=80",
"--https-port=443",
]
fake-gcs:
build: dev/fake-gcs
environment:
- GCP_BUCKET_NAME=activitypub
- GCP_PROJECT_ID=activitypub
volumes:
- ./dev/fake-gcs/storage:/storage
networks:
default:
aliases:
- fake-gcs
test_network:
aliases:
- fake-gcs
healthcheck:
test: "curl -f http://localhost:4443/storage/v1/b/${GCP_BUCKET_NAME}"
interval: 1s
retries: 120
start_period: 5s
networks:
test_network:
driver: bridge
volumes:
test-content:
dev-content:
caddy_data:
caddy_config: