Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
134 lines (121 loc) · 3.83 KB
/
Copy pathdocker-compose.yml
File metadata and controls
134 lines (121 loc) · 3.83 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
# rosscope — full telemetry/observability stack.
#
# docker compose up # default: synthetic fleet, no ROS needed
# docker compose --profile ros up # also run the ROS 2 bridge + a demo bot
#
# Open http://localhost:8000 once the api service is healthy.
x-pg-env: &pg-env
PG_DSN: postgresql://rosscope:rosscope@db:5432/rosscope
REDIS_URL: redis://redis:6379/0
services:
db:
image: timescale/timescaledb:2.15.3-pg16
environment:
POSTGRES_USER: rosscope
POSTGRES_PASSWORD: rosscope
POSTGRES_DB: rosscope
volumes:
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U rosscope"]
interval: 5s
timeout: 3s
retries: 10
redis:
image: redis:7-alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
ingest:
build: { context: ., dockerfile: ingest/Dockerfile }
environment: *pg-env
depends_on:
db: { condition: service_healthy }
redis: { condition: service_healthy }
restart: unless-stopped
alerts:
build: { context: ., dockerfile: alerts/Dockerfile }
environment:
<<: *pg-env
RULES_PATH: /app/alerts/rules.yaml
depends_on:
db: { condition: service_healthy }
redis: { condition: service_healthy }
restart: unless-stopped
api:
build: { context: ., dockerfile: api/Dockerfile }
environment: *pg-env
ports: ["8000:8000"]
depends_on:
db: { condition: service_healthy }
redis: { condition: service_healthy }
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/healthz', timeout=2)"]
interval: 5s
timeout: 3s
retries: 10
restart: unless-stopped
# ---- default data source: synthetic fleet (no ROS) ----
sim:
build: { context: ., dockerfile: sim/Dockerfile }
environment:
<<: *pg-env
ROBOTS: alpha,bravo,charlie
RATE_HZ: "10"
depends_on:
redis: { condition: service_healthy }
restart: unless-stopped
# ---- optional ROS 2 path (profile: ros) ----
bridge:
build: { context: ., dockerfile: bridge/Dockerfile }
profiles: ["ros"]
environment:
<<: *pg-env
ROBOT_ID: ros-1
depends_on:
redis: { condition: service_healthy }
restart: unless-stopped
demo-bot:
build: { context: ., dockerfile: bridge/Dockerfile }
profiles: ["ros"]
command: bash -lc "source /opt/ros/humble/setup.bash && python3 bridge/ros_demo_bot.py"
restart: unless-stopped
# ---- monitoring stack (profile: monitoring) ----
# docker compose --profile monitoring up -> Grafana on :3000, Prometheus on :9090
prometheus:
image: prom/prometheus:v2.54.1
profiles: ["monitoring"]
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
ports: ["9090:9090"]
depends_on:
api: { condition: service_healthy }
restart: unless-stopped
grafana:
image: grafana/grafana:11.2.0
profiles: ["monitoring"]
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: Viewer
volumes:
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards:ro
ports: ["3000:3000"]
depends_on: [prometheus]
restart: unless-stopped
# ---- benchmark harness (profile: bench) ----
# docker compose --profile bench run --rm bench --count 100000
bench:
build: { context: ., dockerfile: bench/Dockerfile }
profiles: ["bench"]
environment: *pg-env
depends_on:
db: { condition: service_healthy }
redis: { condition: service_healthy }
volumes:
pgdata: