-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
69 lines (65 loc) · 1.91 KB
/
docker-compose.yml
File metadata and controls
69 lines (65 loc) · 1.91 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
# nfo DevOps Demo Stack
# Usage: docker compose up --build
#
# Services:
# nfo-demo → FastAPI app with all nfo sinks (http://localhost:8000)
# prometheus → scrapes /metrics from nfo-demo (http://localhost:9091)
# grafana → dashboards for nfo metrics (http://localhost:3000, admin/admin)
services:
nfo-demo:
build:
context: .
dockerfile: demo/Dockerfile
container_name: nfo-demo
ports:
- "8088:8000" # FastAPI app (host:container)
- "9099:9090" # prometheus_client built-in /metrics
environment:
- NFO_ENV=docker
- NFO_VERSION=0.2.0
- NFO_LOG_DIR=/data/logs
- NFO_PROMETHEUS_PORT=9090
volumes:
- nfo-logs:/data/logs
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/')"]
interval: 10s
timeout: 5s
retries: 3
restart: unless-stopped
prometheus:
image: prom/prometheus:v2.51.0
container_name: nfo-prometheus
ports:
- "9091:9090"
volumes:
- ./demo/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.retention.time=7d"
- "--web.enable-lifecycle"
depends_on:
nfo-demo:
condition: service_healthy
restart: unless-stopped
grafana:
image: grafana/grafana:10.4.0
container_name: nfo-grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- ./demo/grafana/provisioning:/etc/grafana/provisioning:ro
- ./demo/grafana/dashboards:/var/lib/grafana/dashboards:ro
- grafana-data:/var/lib/grafana
depends_on:
- prometheus
restart: unless-stopped
volumes:
nfo-logs:
prometheus-data:
grafana-data: