-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
77 lines (73 loc) · 2.27 KB
/
Copy pathdocker-compose.yml
File metadata and controls
77 lines (73 loc) · 2.27 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
services:
app:
build: .
container_name: lazyblog-app
volumes:
- .:/var/www/html
working_dir: /var/www/html
command: sh -c "[ -d vendor ] || composer install --no-interaction; exec php-fpm"
environment:
PHP_OPCACHE_VALIDATE_TIMESTAMPS: "1"
extra_hosts:
- "host.docker.internal:host-gateway"
restart: unless-stopped
web:
image: caddy:2-alpine
container_name: lazyblog-web
ports:
- "${WEB_PORT:-8080}:8080"
volumes:
- .:/var/www/html
- ./docker/Caddyfile.dev:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
depends_on:
- app
restart: unless-stopped
# --- Blog B (federation test peer) ------------------------------------
# Opt-in via profile:
# docker compose --profile blog-b up -d
# Shares the project code (single bind mount) but overlays its own .env
# and content directory so the two blogs have independent identity +
# storage. Default port 8081 on host. The graffiti plugin auto-rewrites
# `localhost` → `host.docker.internal` for cross-blog server calls when
# GRAFFITI_DEV=1, so the in-container outbox actually reaches the host
# port mapping.
app-b:
build: .
container_name: lazyblog-app-b
profiles: ["blog-b"]
volumes:
- .:/var/www/html
- ./.env.blog-b:/var/www/html/.env:ro
- ./content-b:/var/www/html/content
working_dir: /var/www/html
environment:
PHP_OPCACHE_VALIDATE_TIMESTAMPS: "1"
extra_hosts:
- "host.docker.internal:host-gateway"
restart: unless-stopped
web-b:
image: caddy:2-alpine
container_name: lazyblog-web-b
profiles: ["blog-b"]
ports:
- "${WEB_PORT_B:-8081}:8080"
volumes:
- .:/var/www/html
- ./.env.blog-b:/var/www/html/.env:ro
- ./content-b:/var/www/html/content
# Blog B uses its own Caddyfile so the FastCGI upstream points at
# `app-b:9000` instead of `app:9000` — without this both webs proxy
# to blog A's PHP-FPM and you see Blog A data on both ports.
- ./docker/Caddyfile.blog-b.dev:/etc/caddy/Caddyfile:ro
- caddy_data_b:/data
- caddy_config_b:/config
depends_on:
- app-b
restart: unless-stopped
volumes:
caddy_data:
caddy_config:
caddy_data_b:
caddy_config_b: