forked from openfga/openfga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
112 lines (106 loc) · 3.1 KB
/
docker-compose.yaml
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
services:
postgres:
image: postgres:14
container_name: postgres
networks:
- default
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
migrate:
depends_on:
postgres:
condition: service_healthy
image: openfga/openfga:latest
container_name: migrate
environment:
- OPENFGA_DATASTORE_ENGINE=postgres
- OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/postgres?sslmode=disable
command: migrate
networks:
- default
openfga:
depends_on:
migrate:
condition: service_completed_successfully
otel-collector:
condition: service_started
image: openfga/openfga:latest
container_name: openfga
command: run
environment:
- OPENFGA_DATASTORE_ENGINE=postgres
- OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/postgres?sslmode=disable
- OPENFGA_TRACE_ENABLED=true
- OPENFGA_TRACE_SAMPLE_RATIO=1
- OPENFGA_TRACE_OTLP_ENDPOINT=otel-collector:4317
- OPENFGA_METRICS_ENABLE_RPC_HISTOGRAMS=true
networks:
- default
ports:
- "8080:8080" #http
- "8081:8081" #grpc
- "3000:3000" #playground
- "2112:2112" #prometheus metrics
healthcheck:
test: ["CMD", "/bin/grpc_health_probe", "-addr=openfga:8081"]
interval: 5s
timeout: 30s
retries: 3
otel-collector:
image: otel/opentelemetry-collector:latest
container_name: otel-collector
command: [ "--config=/etc/otel-collector-config.yaml" ]
volumes:
- "./telemetry/otel-collector-config.yaml:/etc/otel-collector-config.yaml"
networks:
- default
ports:
- "4317:4317" #grpc OTLP receiver
- "2113:2113" #prometheus metrics exporter
jaeger:
image: jaegertracing/all-in-one:latest
container_name: jaeger
command: ["--query.max-clock-skew-adjustment", "500ms"]
ports:
- "16686:16686" # UI
depends_on:
- otel-collector
networks:
- default
prometheus:
image: prom/prometheus:v2.30.3
ports:
- 9090:9090 # UI
depends_on:
- otel-collector
volumes:
- ./telemetry/prometheus:/etc/prometheus
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
grafana:
image: grafana/grafana
ports:
- 3001:3000 # UI
restart: unless-stopped
depends_on:
prometheus:
condition: service_started
volumes:
- ./telemetry/grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
- ./telemetry/grafana/provisioning/dashboards/dashboards.yml:/etc/grafana/provisioning/dashboards/main.yaml
- ./telemetry/grafana/dashboards:/etc/grafana/dashboards
- grafana_data:/var/lib/grafana
volumes:
prometheus_data:
grafana_data: