-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
65 lines (61 loc) · 1.88 KB
/
Copy pathdocker-compose.yml
File metadata and controls
65 lines (61 loc) · 1.88 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
# Usage:
# Server only: docker compose up -d
# With monitoring: docker compose --profile monitoring up -d
#
# Monitoring (Prometheus + Grafana) is optional via the "monitoring" profile.
# Grafana: http://localhost:3000 (admin / certstream)
# Prometheus: http://localhost:9090
services:
certstream-server-rust:
build: .
ports:
- "${PORT:-8080}:${PORT:-8080}"
environment:
- CERTSTREAM_HOST=${HOST:-0.0.0.0}
- CERTSTREAM_PORT=${PORT:-8080}
- CERTSTREAM_LOG_LEVEL=${LOG_LEVEL:-info}
- CERTSTREAM_BUFFER_SIZE=${BUFFER_SIZE:-1000}
- CERTSTREAM_SSE_ENABLED=${SSE_ENABLED:-true}
volumes:
- ./config.yaml:/etc/certstream/config.yaml:ro
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8080/health/deep"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
# Optional: Prometheus metrics collection
prometheus:
image: prom/prometheus:latest
profiles: [monitoring]
ports:
- "${PROMETHEUS_PORT:-9090}:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
depends_on:
certstream-server-rust:
condition: service_started
restart: unless-stopped
# Optional: Grafana dashboard
grafana:
image: grafana/grafana:latest
profiles: [monitoring]
ports:
- "${GRAFANA_PORT:-3000}:3000"
environment:
- GF_SECURITY_ADMIN_USER=${GRAFANA_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-certstream}
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- ./grafana/provisioning:/etc/grafana/provisioning:ro
- ./grafana/dashboards:/var/lib/grafana/dashboards:ro
- grafana_data:/var/lib/grafana
depends_on:
prometheus:
condition: service_started
restart: unless-stopped
volumes:
prometheus_data:
grafana_data: