-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yml
205 lines (190 loc) · 5.74 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
services:
activitypub:
build: .
volumes:
- ./src:/opt/activitypub/src
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=activitypub_topic_changeme
- MQ_PUBSUB_SUBSCRIPTION_NAME=activitypub_subscription_changeme
command: yarn build:watch
depends_on:
migrate:
condition: service_started
mysql:
condition: service_healthy
pubsub:
condition: service_healthy
jaeger:
image: jaegertracing/all-in-one:1.62.0
container_name: activitypub-jaeger
ports:
- "4318:4318"
- "16686:16686"
- "9411:9411"
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
scripts:
build: scripts
depends_on:
- activitypub
- fake-mastodon
nginx:
build: nginx
ports:
- "80:80"
depends_on:
- activitypub
mysql:
image: mysql:8.0.31
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
pubsub:
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:499.0.0-emulators
ports:
- "8085:8085"
command: /bin/bash -c "/opt/activitypub/start-pubsub.sh"
volumes:
- ./pubsub/start.sh:/opt/activitypub/start-pubsub.sh
environment:
- PROJECT_ID=activitypub
- TOPIC_NAME=activitypub_topic_changeme
- SUBSCRIPTION_NAME=activitypub_subscription_changeme
- PUSH_ENDPOINT=http://activitypub:8080/.ghost/activitypub/mq
healthcheck:
test: "curl -f http://localhost:8085 || exit 1"
interval: 1s
retries: 120
start_period: 5s
# Testing
activitypub-testing:
build: .
volumes:
- ./src:/opt/activitypub/src
environment:
- PORT=8083
- MYSQL_USER=ghost
- MYSQL_PASSWORD=password
- 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=activitypub_topic_changeme
- MQ_PUBSUB_SUBSCRIPTION_NAME=activitypub_subscription_changeme
command: yarn build:watch
depends_on:
mysql-testing:
condition: service_healthy
pubsub-testing:
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:
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:
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
command: yarn run cucumber-js
depends_on:
fake-ghost-activitypub:
condition: service_started
fake-external-activitypub:
condition: service_started
activitypub-testing:
condition: service_healthy
mysql-testing:
image: mysql:8.0.31
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
pubsub-testing:
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:499.0.0-emulators
ports:
- "8086:8085"
command: /bin/bash -c "/opt/activitypub/start-pubsub.sh"
volumes:
- ./pubsub/start.sh:/opt/activitypub/start-pubsub.sh
environment:
- PROJECT_ID=activitypub
- TOPIC_NAME=activitypub_topic_changeme
- SUBSCRIPTION_NAME=activitypub_subscription_changeme
- PUSH_ENDPOINT=http://activitypub-testing:8083/.ghost/activitypub/mq
healthcheck:
test: "curl -f http://localhost:8085 || exit 1"
interval: 1s
retries: 120
start_period: 5s
fake-ghost-activitypub:
image: wiremock/wiremock:3.9.2-1
entrypoint: [ "/docker-entrypoint.sh", "--global-response-templating", "--disable-gzip", "--verbose", "--port=80", "--https-port=443" ]
volumes:
- ./wiremock/fake-ghost/mappings:/home/wiremock/mappings
fake-external-activitypub:
image: wiremock/wiremock:3.9.2-1
entrypoint: [ "/docker-entrypoint.sh", "--global-response-templating", "--disable-gzip", "--verbose", "--port=80", "--https-port=443" ]
fake-mastodon:
image: wiremock/wiremock:3.9.2-1
ports:
- "8084:8080"
entrypoint: [ "/docker-entrypoint.sh", "--global-response-templating", "--disable-gzip", "--verbose" ]