trails/docker-compose.dev.yml
Ullrich Schäfer 8fd3dda8c6
Add BRouter healthcheck so compose --wait blocks until routing is ready
Without a healthcheck, --wait considers BRouter healthy as soon as the
container starts, before it has loaded segments and opened its port.
The healthcheck probes the routing endpoint directly, matching the old
manual curl loop in CI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 23:12:23 +02:00

72 lines
2.1 KiB
YAML

services:
postgres:
image: imresamu/postgis:16-3.4 # multi-arch (amd64 + arm64)
ports:
- "5432:5432"
environment:
POSTGRES_USER: trails
POSTGRES_PASSWORD: trails
POSTGRES_DB: trails
command: ["postgres", "-c", "shared_preload_libraries=pg_stat_statements"]
volumes:
- pgdata:/var/lib/postgresql/data
- ./infrastructure/postgres/init-grafana-user.sql:/docker-entrypoint-initdb.d/init-grafana-user.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U trails"]
interval: 5s
timeout: 5s
retries: 5
brouter:
build: docker/brouter
ports:
- "17777:17777"
volumes:
- brouter_segments:/data/segments
healthcheck:
test: ["CMD-SHELL", "curl -sf 'http://localhost:17777/brouter?lonlats=13.4,52.5|13.5,52.5&profile=trekking&format=geojson' > /dev/null"]
interval: 10s
timeout: 10s
retries: 12
start_period: 30s
prometheus:
image: prom/prometheus:latest
profiles: [monitoring]
ports:
- "9090:9090"
volumes:
- ./infrastructure/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
grafana:
image: grafana/grafana:latest
profiles: [monitoring]
ports:
- "3002:3000"
environment:
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
GF_AUTH_DISABLE_LOGIN_FORM: "true"
volumes:
- ./infrastructure/grafana/provisioning/datasources:/etc/grafana/provisioning/datasources:ro
- ./infrastructure/grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards:ro
- ./infrastructure/grafana/dashboards:/var/lib/grafana/dashboards:ro
- grafana_data:/var/lib/grafana
loki:
image: grafana/loki:latest
profiles: [monitoring]
ports:
- "3100:3100"
volumes:
- ./infrastructure/loki/loki-config.yml:/etc/loki/local-config.yaml:ro
- loki_data:/loki
command: ["-config.file=/etc/loki/local-config.yaml"]
volumes:
pgdata:
brouter_segments:
prometheus_data:
grafana_data:
loki_data: