-
-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Expand file tree
/
Copy pathcompose.dev.yaml
More file actions
174 lines (166 loc) · 6.07 KB
/
Copy pathcompose.dev.yaml
File metadata and controls
174 lines (166 loc) · 6.07 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
name: ghost-dev
services:
mysql:
image: mysql:8.4.11@sha256:b3b90af2a6552ae30c266fdb7d5dd55f3afb72404bb78d37fe8a23eb857fd3fb
container_name: ghost-dev-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 --log-error-verbosity=1
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
MYSQL_DATABASE: ${MYSQL_DATABASE:-ghost_dev}
MYSQL_USER: ghost
MYSQL_PASSWORD: ghost
volumes:
- mysql-data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysql", "-h", "127.0.0.1", "-uroot", "-p${MYSQL_ROOT_PASSWORD:-root}", "-e", "SELECT 1"]
interval: 1s
retries: 120
timeout: 5s
start_period: 10s
redis:
image: redis:7.4@sha256:e9b2e45ecd47fbb69b877cf8d045d5cccaaaed52524b6e098b4abe8212994f73
container_name: ghost-dev-redis
command: ["redis-server", "--loglevel", "warning"]
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test:
- CMD
- redis-cli
- --raw
- incr
- ping
interval: 1s
retries: 120
mailpit:
image: axllent/mailpit@sha256:d5ecbb067db3705fa953d79e1b7f81ef84038df67aba6c52825d8c02a1ea748a
container_name: ghost-dev-mailpit
command: ["--quiet"]
ports:
- "1025:1025" # SMTP server
- "8025:8025" # Web interface
- "8026:8025" # Web interface (for e2e tests)
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8025"]
interval: 1s
retries: 30
# Main development Ghost instance
# Additional instances can be created programmatically via E2E GhostManager
ghost-dev:
build:
context: ./
dockerfile: docker/ghost-dev/Dockerfile
container_name: ghost-dev
working_dir: /home/ghost/ghost/core
command: ["pnpm", "dev"]
volumes:
# Mount the backend source as whole-directory mounts instead of
# enumerating each server-graph workspace package. `pnpm dev` runs in
# ghost/core, and pnpm's verify-deps-before-run only checks ghost/core's
# own dependency closure — which is fully installed in the root
# /home/ghost/node_modules baked into the image and never mounted over —
# so the non-server packages these dirs also expose (e.g. koenig-lexical)
# fall outside that closure and don't trigger a
# workspace repair. Because root node_modules is never mounted,
# linux-built native modules survive; each package's local node_modules
# holds only relative symlinks that re-resolve into the root store.
# verify-deps-before-run=false is set below as belt-and-suspenders in
# case a future pnpm widens that check back to the whole workspace.
- ./ghost:/home/ghost/ghost
- ./koenig:/home/ghost/koenig
- ./configs:/home/ghost/configs
- ./packages:/home/ghost/packages
# Mount specific content subdirectories to preserve themes/adapters from source
- ghost-dev-data:/home/ghost/ghost/core/content/data
- ghost-dev-images:/home/ghost/ghost/core/content/images
- ghost-dev-media:/home/ghost/ghost/core/content/media
- ghost-dev-files:/home/ghost/ghost/core/content/files
- ghost-dev-logs:/home/ghost/ghost/core/content/logs
- shared-config:/mnt/shared-config:ro
environment:
NODE_ENV: development
NODE_TLS_REJECT_UNAUTHORIZED: "0"
DEBUG: ${DEBUG:-}
pnpm_config_verify_deps_before_run: "false"
database__client: mysql2
database__connection__host: mysql
database__connection__user: root
database__connection__password: ${MYSQL_ROOT_PASSWORD:-root}
database__connection__database: ${MYSQL_DATABASE:-ghost_dev}
server__host: 0.0.0.0
server__port: 2368
mail__transport: SMTP
mail__options__host: mailpit
mail__options__port: 1025
# Redis cache (optional)
adapters__cache__Redis__host: redis
adapters__cache__Redis__port: 6379
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
mailpit:
condition: service_healthy
stripe:
condition: service_healthy
required: false
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:2368',{redirect:'manual'}).then(r=>process.exit(r.status<500?0:1)).catch(()=>process.exit(1))"]
timeout: 5s
retries: 10
start_period: 5s
# Caddy reverse proxy for the main dev instance
# Routes Ghost backend + proxies asset requests to host dev servers
ghost-dev-gateway:
build:
context: ./docker/dev-gateway
dockerfile: Dockerfile
container_name: ghost-dev-gateway
ports:
- "2368:80"
- "80:80"
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
# Mount Caddyfile for live config changes without rebuilding
- ./docker/dev-gateway/Caddyfile:/etc/caddy/Caddyfile:ro
# All workspace apps mounted read-only. Caddy file_server resolves
# /srv/apps/<name>/umd dynamically for the public-app routes (see
# the Caddyfile @public_app block). Replaces the per-app `vite preview`
# sirv layer + avoids per-app bind mounts.
- ./apps:/srv/apps:ro
depends_on:
ghost-dev:
condition: service_healthy
stripe:
image: stripe/stripe-cli:latest@sha256:e35a010404b9b527249283bad6b1360430f4eb22a2f7726dc1d8735509a5fbda
container_name: ghost-dev-stripe
entrypoint: ["/entrypoint.sh"]
profiles: ["stripe"]
volumes:
- ./docker/stripe/entrypoint.sh:/entrypoint.sh:ro
- shared-config:/mnt/shared-config
environment:
- GHOST_URL=${GHOST_URL:-http://ghost-dev:2368}
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY:-}
healthcheck:
test: ["CMD", "test", "-f", "/mnt/shared-config/.env.stripe"]
interval: 1s
retries: 120
volumes:
mysql-data:
redis-data:
shared-config:
ghost-dev-data:
ghost-dev-images:
ghost-dev-media:
ghost-dev-files:
ghost-dev-logs:
networks:
default:
name: ghost_dev