-
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
348 lines (330 loc) · 10.6 KB
/
docker-compose.yml
File metadata and controls
348 lines (330 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
services:
activitypub:
build: .
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: yarn 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
jaeger:
image: jaegertracing/all-in-one:1.76.0@sha256:ab6f1a1f0fb49ea08bcd19f6b84f6081d0d44b364b6de148e1798eb5816bacac
restart: always
environment:
COLLECTOR_ZIPKIN_HOST_PORT: :9411
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.8@sha256:669b2d89f3916f5263af230ffa20889a03c7f4bedf58133fe8780466c613f7ae
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_USER=ghost
- MYSQL_PASSWORD=password
- MYSQL_DATABASE=activitypub
ports:
- "3307:3306"
healthcheck:
test: "mysql -ughost -ppassword activitypub -e 'select 1'"
interval: 1s
retries: 120
redis:
image: redis:7-alpine@sha256:8b81dd37ff027bec4e516d41acfbe9fe2460070dc6d4a4570a2ac5b9d59df065
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:499.0.0-emulators@sha256:38606e0ec8b892ff2be6fb7238c6b98e7b0b69f60ed433fa2b196bdf4646caf9
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: .
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
command: yarn 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: .
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.8@sha256:669b2d89f3916f5263af230ffa20889a03c7f4bedf58133fe8780466c613f7ae
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_USER=ghost
- MYSQL_PASSWORD=password
- MYSQL_DATABASE=activitypub
healthcheck:
test: "mysql -ughost -ppassword activitypub -e 'select 1'"
interval: 1s
retries: 120
redis-testing:
networks:
- test_network
image: redis:7-alpine@sha256:8b81dd37ff027bec4e516d41acfbe9fe2460070dc6d4a4570a2ac5b9d59df065
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:499.0.0-emulators@sha256:38606e0ec8b892ff2be6fb7238c6b98e7b0b69f60ed433fa2b196bdf4646caf9
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:1e40b251ca9639ead7b5cd2cedcc8765adfbabb99450fe23f130eefabf50f4bc
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: