forked from TryGhost/Ghost
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.dev.yaml
More file actions
151 lines (143 loc) · 4.37 KB
/
compose.dev.yaml
File metadata and controls
151 lines (143 loc) · 4.37 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
name: ghost-dev
services:
mysql:
image: mysql:8.4.5
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
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.0
container_name: ghost-dev-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test:
- CMD
- redis-cli
- --raw
- incr
- ping
interval: 1s
retries: 120
mailpit:
image: axllent/mailpit
container_name: ghost-dev-mailpit
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: ["yarn", "dev"]
volumes:
- ./ghost:/home/ghost/ghost
# 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:-}
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
depends_on:
ghost-dev:
condition: service_healthy
stripe:
image: stripe/stripe-cli:latest
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