forked from miparnisari/fgademo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
131 lines (124 loc) · 3.69 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
services:
postgres:
image: postgres:14
container_name: postgres
command: postgres -c 'max_connections=100'
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:v1.3.5
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:v1.3.5
container_name: openfga
command: run
environment:
- OPENFGA_DATASTORE_ENGINE=postgres
- OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/postgres?sslmode=disable
- OPENFGA_DATASTORE_MAX_OPEN_CONNS=100 #see postgres container
- OPENFGA_TRACE_ENABLED=true
- OPENFGA_TRACE_SAMPLE_RATIO=1
- OPENFGA_TRACE_OTLP_ENDPOINT=otel-collector:4317
- OPENFGA_METRICS_ENABLE_RPC_HISTOGRAMS=true
- OPENFGA_DATASTORE_METRICS_ENABLED=true
- OPENFGA_METRICS_ENABLED=TRUE
networks:
- default
ports:
- "8080:8080" #http
- "8081:8081" #grpc
- "3000:3000" #playground
- "2112:2112" #prometheus metrics
healthcheck:
test: ["CMD", "/usr/local/bin/grpc_health_probe", "-addr=openfga:8081"]
interval: 3s
timeout: 30s
retries: 3
otel-collector:
image: otel/opentelemetry-collector:0.88.0
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:1.49
container_name: jaeger
command: ["--query.max-clock-skew-adjustment", "500ms"]
environment:
- COLLECTOR_OTLP_ENABLED=true
- SPAN_STORAGE_TYPE=badger
- BADGER_EPHEMERAL=false
- BADGER_DIRECTORY_VALUE=/badger/data
- BADGER_DIRECTORY_KEY=/badger/key
volumes:
- jaeger_data:/badger
ports:
- "16686:16686" # UI
- "4317" # OTLP gRPC default port
depends_on:
- otel-collector
networks:
- default
prometheus:
container_name: prometheus
image: prom/prometheus:v2.47.2
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:
container_name: grafana
image: grafana/grafana:10.2.0
ports:
- 3001:3000 # UI
restart: unless-stopped
environment:
- GF_USERS_DEFAULT_THEME=light
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:
jaeger_data: