Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (65 loc) · 1.72 KB
/
Copy pathdocker-compose.yml
File metadata and controls
71 lines (65 loc) · 1.72 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
# Local development stack. Not meant for production.
# docker compose up --build
# Dashboard: http://localhost:8080
# The agent reports on its own container, not the host.
x-symon-key: &symon-key
SYMON_KEY: ${SYMON_KEY:-dev-only-key}
services:
db:
image: timescale/timescaledb:2.30.1-pg18
environment:
POSTGRES_USER: symon
POSTGRES_PASSWORD: symon
POSTGRES_DB: symon
volumes:
- db-data:/var/lib/postgresql
healthcheck:
test: ["CMD", "pg_isready", "-U", "symon", "-d", "symon"]
interval: 5s
retries: 20
collector:
build:
context: .
target: collector
environment:
<<: *symon-key
SYMON_PORT: "9000"
SYMON_DATABASE_URL: postgres://symon:symon@db:5432/symon?sslmode=disable
SYMON_ALERTS_CONFIG_PATH: alerts.json
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "9000"]
interval: 5s
retries: 20
depends_on:
db:
condition: service_healthy
client:
build:
context: .
target: client
environment:
<<: *symon-key
SYMON_CLIENT_PORT: "8080"
SYMON_CLIENT_COLLECTOR_ENDPOINT: collector:9000
ports:
- "8080:8080"
depends_on:
- collector
agent:
build:
context: .
target: agent
# register first. On restarts -init reports the agent exists, which is fine.
command: ["sh", "-c", "./agent -init; exec ./agent"]
environment:
<<: *symon-key
SYMON_SERVER_ID: test
SYMON_MONITOR_INTERVAL_SECONDS: "15"
SYMON_COLLECTOR_ENDPOINT: collector:9000
# sample tasks to try from the dashboard
SYMON_TASKS_PATH: /app/tasks.json
depends_on:
collector:
condition: service_healthy
volumes:
db-data: