-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
123 lines (114 loc) · 3.47 KB
/
docker-compose.yml
File metadata and controls
123 lines (114 loc) · 3.47 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
networks:
fleet:
driver: bridge
services:
# ---------------------------------------------------------------------------
# Core infrastructure (always started)
# ---------------------------------------------------------------------------
mysql:
image: mysql:8.4
restart: unless-stopped
networks: [fleet]
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-devpassword}
MYSQL_DATABASE: uptime_bench
MYSQL_USER: uptime_bench
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-devpassword}
ports:
- "${MYSQL_PORT:-3306}:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./schema:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root",
"--password=${MYSQL_ROOT_PASSWORD:-devpassword}"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
adminer:
image: adminer:latest
restart: unless-stopped
networks: [fleet]
ports:
- "${ADMINER_PORT:-8081}:8080"
depends_on:
mysql:
condition: service_healthy
# ---------------------------------------------------------------------------
# Fleet services (profile: fleet)
# target-01 has Docker network aliases for bench.local and probe.local so
# that services on the fleet network can resolve those names without an
# external DNS server. This is a local-dev convenience; in production the
# bench DNS servers are authoritative for these domains.
# ---------------------------------------------------------------------------
target-01:
build: .
profiles: [fleet]
restart: unless-stopped
networks:
fleet:
aliases:
- bench.local
- probe.local
command: ["uptime-bench-target", "-http-port=80", "-https-port=443", "-control-port=9000"]
ports:
- "8080:80"
- "8443:443"
environment:
CONTROL_TOKEN: ${CONTROL_TOKEN:-devtoken}
dns-01:
build: .
profiles: [fleet]
restart: unless-stopped
networks: [fleet]
command: [
"uptime-bench-dns",
"-dns-port=53",
"-control-port=9100",
"-zone=bench.local:target-01",
"-zone=probe.local:target-01"
]
environment:
CONTROL_TOKEN: ${CONTROL_TOKEN:-devtoken}
dns-02:
build: .
profiles: [fleet]
restart: unless-stopped
networks: [fleet]
command: [
"uptime-bench-dns",
"-dns-port=53",
"-control-port=9100",
"-zone=bench.local:target-01",
"-zone=probe.local:target-01"
]
environment:
CONTROL_TOKEN: ${CONTROL_TOKEN:-devtoken}
# harness is intentionally NOT in any auto-started profile.
# Use `make run-scenario` (or `docker compose run harness`) to invoke it.
# docker compose run always starts the specified service regardless of profiles.
harness:
build: .
profiles: [harness]
restart: "no"
networks: [fleet]
volumes:
- ./docker/fleet.local.toml:/etc/uptime-bench/fleet.toml:ro
- ./services.toml:/etc/uptime-bench/services.toml:ro
- ./scenarios:/scenarios:ro
- ./configs/campaign:/campaigns:ro
environment:
CONTROL_TOKEN: ${CONTROL_TOKEN:-devtoken}
DB_DSN: "uptime_bench:${MYSQL_PASSWORD:-devpassword}@tcp(mysql:3306)/uptime_bench?parseTime=true"
depends_on:
mysql:
condition: service_healthy
target-01:
condition: service_started
dns-01:
condition: service_started
dns-02:
condition: service_started
volumes:
mysql_data: