forked from TryGhost/Ghost
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yml
More file actions
329 lines (312 loc) · 10.2 KB
/
compose.yml
File metadata and controls
329 lines (312 loc) · 10.2 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
name: ghost
# Template to share volumes and environment variable between all services running the same base image
x-service-template: &service-template
volumes:
- .:/home/ghost
- ${SSH_AUTH_SOCK}:/ssh-agent
- ${HOME}/.gitconfig:/root/.gitconfig:ro
- ${HOME}/.yalc:/root/.yalc
- shared-config:/mnt/shared-config:ro
- node_modules_yarn_lock_hash:/home/ghost/.yarnhash:delegated
- node_modules_ghost_root:/home/ghost/node_modules:delegated
- node_modules_ghost_admin:/home/ghost/ghost/admin/node_modules:delegated
- node_modules_ghost_core:/home/ghost/ghost/core/node_modules:delegated
- node_modules_ghost_i18n:/home/ghost/ghost/i18n/node_modules:delegated
- node_modules_e2e:/home/ghost/e2e/node_modules:delegated
- node_modules_apps_activitypub:/home/ghost/apps/activitypub/node_modules:delegated
- node_modules_apps_admin-x-design-system:/home/ghost/apps/admin-x-design-system/node_modules:delegated
- node_modules_apps_admin-x-framework:/home/ghost/apps/admin-x-framework/node_modules:delegated
- node_modules_apps_admin-x-settings:/home/ghost/apps/admin-x-settings/node_modules:delegated
- node_modules_apps_announcement-bar:/home/ghost/apps/announcement-bar/node_modules:delegated
- node_modules_apps_comments-ui:/home/ghost/apps/comments-ui/node_modules:delegated
- node_modules_apps_portal:/home/ghost/apps/portal/node_modules:delegated
- node_modules_apps_posts:/home/ghost/apps/posts/node_modules:delegated
- node_modules_apps_shade:/home/ghost/apps/shade/node_modules:delegated
- node_modules_apps_signup-form:/home/ghost/apps/signup-form/node_modules:delegated
- node_modules_apps_sodo-search:/home/ghost/apps/sodo-search/node_modules:delegated
- node_modules_apps_stats:/home/ghost/apps/stats/node_modules:delegated
environment:
- DEBUG=${DEBUG:-}
- SSH_AUTH_SOCK=/ssh-agent
- NX_DAEMON=${NX_DAEMON:-true}
- GHOST_DEV_IS_DOCKER=true
- GHOST_DEV_APP_FLAGS=${GHOST_DEV_APP_FLAGS:-}
- GHOST_UPSTREAM=${GHOST_UPSTREAM:-}
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY:-}
- STRIPE_PUBLISHABLE_KEY=${STRIPE_PUBLISHABLE_KEY:-}
- STRIPE_ACCOUNT_ID=${STRIPE_ACCOUNT_ID:-}
services:
server:
<<: *service-template
image: ghost-monorepo:latest
build:
context: .
dockerfile: ./.docker/Dockerfile
target: development
entrypoint: [ "/home/ghost/.docker/development.entrypoint.sh" ]
working_dir: /home/ghost/ghost/core
command: [ "yarn", "dev" ]
ports:
- "2368:2368"
profiles: [ split, all ]
tty: true
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
tinybird-local:
condition: service_healthy
required: false
analytics:
condition: service_healthy
required: false
tb-cli:
condition: service_completed_successfully
required: false
stripe:
condition: service_healthy
required: false
environment:
- DEBUG=${DEBUG:-}
- SSH_AUTH_SOCK=/ssh-agent
- NX_DAEMON=false
- GHOST_DEV_IS_DOCKER=true
- GHOST_DEV_APP_FLAGS=${GHOST_DEV_APP_FLAGS:-}
- GHOST_UPSTREAM=${GHOST_UPSTREAM:-}
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY:-}
- STRIPE_PUBLISHABLE_KEY=${STRIPE_PUBLISHABLE_KEY:-}
- STRIPE_ACCOUNT_ID=${STRIPE_ACCOUNT_ID:-}
- TB_HOST=${TB_HOST:-http://tinybird-local:7181}
- TB_LOCAL_HOST=${TB_LOCAL_HOST:-tinybird-local}
- tinybird__stats__endpoint=http://tinybird-local:7181
- tinybird__stats__endpointBrowser=http://localhost:7181
- tinybird__tracker__endpoint=http://localhost/.ghost/analytics/api/v1/page_hit
admin:
<<: *service-template
image: ghost-monorepo:latest
entrypoint: [ "/home/ghost/.docker/development.entrypoint.sh" ]
working_dir: /home/ghost/ghost/admin
command: [ "yarn", "dev" ]
ports:
- "4200:4200"
- "4201:4201"
profiles: [ split, all ]
tty: true
admin-apps:
<<: *service-template
image: ghost-monorepo:latest
entrypoint: [ "/home/ghost/.docker/development.entrypoint.sh" ]
working_dir: /home/ghost
command: [ "node", "/home/ghost/.docker/watch-admin-apps.js" ]
profiles: [ split, all ]
tty: true
restart: always
environment:
- CHOKIDAR_USEPOLLING=true
- CHOKIDAR_INTERVAL=1000
- FORCE_COLOR=1
caddy:
image: caddy:latest
container_name: ghost-caddy
profiles: [ split, all ]
ports:
- "80:80"
- "443:443"
volumes:
- ./.docker/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
environment:
- ANALYTICS_PROXY_TARGET=${ANALYTICS_PROXY_TARGET:-analytics:3000}
restart: always
ghost:
<<: *service-template
image: ghost-monorepo:latest
build:
context: .
dockerfile: ./.docker/Dockerfile
target: development
entrypoint: [ "/home/ghost/.docker/development.entrypoint.sh" ]
command: [ "yarn", "dev" ]
ports:
- "2368:2368" # Ghost
- "4200:4200" # Admin
- "4201:4201" # Admin tests
- "4175:4175" # Portal
- "4176:4176" # Portal HTTPS
- "4177:4177" # Announcement bar
- "4178:4178" # Search
- "6174:6174" # Signup form
- "7173:7173" # Comments
- "7174:7174" # Comments HTTPS
profiles: [ ghost, all]
tty: true
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
mysql:
image: mysql:8.4.5
container_name: ghost-mysql
command: --innodb-buffer-pool-size=1G --innodb-log-buffer-size=500M --innodb-change-buffer-max-size=50 --innodb-flush-log-at-trx_commit=0 --innodb-flush-method=O_DIRECT
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ghost
restart: always
volumes:
- ./.docker/mysql-preload:/docker-entrypoint-initdb.d
- mysql-data:/var/lib/mysql
healthcheck:
test: mysql -uroot -proot ghost -e 'select 1'
interval: 1s
retries: 120
redis:
image: redis:7.0
container_name: ghost-redis
ports:
- 6379:6379
restart: always
volumes:
- redis-data:/data
healthcheck:
test:
- CMD
- redis-cli
- --raw
- incr
- ping
interval: 1s
retries: 120
analytics:
profiles: [ analytics, all ]
image: ghost/traffic-analytics:1.0.19
platform: linux/amd64
command: ["node", "--enable-source-maps", "dist/server.js"]
entrypoint: [ "/app/entrypoint.sh" ]
container_name: ghost-analytics
ports:
- "3000:3000"
healthcheck:
# Simpler: use Node's global fetch (Node 18+)
test: ["CMD-SHELL", "node -e \"fetch('http://localhost:3000').then(r=>process.exit(r.status<500?0:1)).catch(()=>process.exit(1))\"" ]
interval: 1s
retries: 120
volumes:
- ./.docker/analytics/entrypoint.sh:/app/entrypoint.sh:ro
- shared-config:/mnt/shared-config:ro
environment:
- PROXY_TARGET=http://tinybird-local:7181/v0/events
depends_on:
tinybird-local:
condition: service_healthy
tb-cli:
condition: service_completed_successfully
tb-cli:
build:
context: .
dockerfile: ./.docker/tb-cli/Dockerfile
profiles: [ analytics, all ]
working_dir: /home/tinybird
tty: true
container_name: ghost-tb-cli
environment:
- TB_HOST=http://tinybird-local:7181
- TB_LOCAL_HOST=tinybird-local
volumes:
- ./ghost/core/core/server/data/tinybird:/home/tinybird
- shared-config:/mnt/shared-config
depends_on:
tinybird-local:
condition: service_healthy
tinybird-local:
profiles: [ analytics, all ]
image: tinybirdco/tinybird-local:latest
platform: linux/amd64
ports:
- "7181:7181"
stop_grace_period: 2s
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7181/v0/health" ]
interval: 1s
timeout: 5s
retries: 120
prometheus:
profiles: [ monitoring, all ]
image: prom/prometheus:v2.55.1
container_name: ghost-prometheus
ports:
- 9090:9090
restart: always
volumes:
- ./.docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
grafana:
profiles: [ monitoring, all ]
image: grafana/grafana:8.5.27
container_name: ghost-grafana
ports:
- 3000:3000
restart: always
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
volumes:
- ./.docker/grafana/datasources:/etc/grafana/provisioning/datasources
- ./.docker/grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/main.yaml
- ./.docker/grafana/dashboards:/var/lib/grafana/dashboards
pushgateway:
profiles: [ monitoring, all ]
image: prom/pushgateway:v1.11.1
container_name: ghost-pushgateway
ports:
- 9091:9091
mailpit:
image: axllent/mailpit
platform: linux/amd64
container_name: ghost-mailpit
profiles: [ ghost, split, all ]
ports:
- "1025:1025" # SMTP server
- "8025:8025" # Web interface
restart: always
stripe:
image: stripe/stripe-cli:latest
container_name: ghost-stripe
profiles: [ stripe, all ]
entrypoint: [ "/entrypoint.sh" ]
volumes:
- ./.docker/stripe/entrypoint.sh:/entrypoint.sh:ro
- shared-config:/mnt/shared-config
environment:
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY:-}
- STRIPE_PUBLISHABLE_KEY=${STRIPE_PUBLISHABLE_KEY:-}
- STRIPE_ACCOUNT_ID=${STRIPE_ACCOUNT_ID:-}
healthcheck:
test: ["CMD", "test", "-f", "/mnt/shared-config/.env.stripe"]
interval: 1s
retries: 120
volumes:
mysql-data: {}
redis-data: {}
shared-config: {}
caddy_data: {}
node_modules_yarn_lock_hash: {}
node_modules_ghost_root: {}
node_modules_ghost_admin: {}
node_modules_ghost_core: {}
node_modules_ghost_i18n: {}
node_modules_e2e: {}
node_modules_apps_activitypub: {}
node_modules_apps_admin-x-design-system: {}
node_modules_apps_admin-x-framework: {}
node_modules_apps_admin-x-settings: {}
node_modules_apps_announcement-bar: {}
node_modules_apps_comments-ui: {}
node_modules_apps_portal: {}
node_modules_apps_posts: {}
node_modules_apps_shade: {}
node_modules_apps_signup-form: {}
node_modules_apps_sodo-search: {}
node_modules_apps_stats: {}