-
Notifications
You must be signed in to change notification settings - Fork 19
/
docker-compose.yaml
145 lines (141 loc) · 4.22 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
services:
install_plugins:
# This intermediate service is used to install the plugins
# before starting the GatewayD service.
image: alpine:3.20
command: ["/bin/sh", "/setup.sh"]
volumes:
- ./setup.sh:/setup.sh:ro
# Use the variable defined above to mount the GatewayD files.
- ./gatewayd-files:/gatewayd-files:rw
environment:
- GATEWAYD_FILES=/gatewayd-files
# If you want to install a specific version of GatewayD, you can set the
# GATEWAYD_VERSION environment variable to the desired version. Otherwise,
# the latest version will be installed.
# - GATEWAYD_VERSION=v0.9.5
# The architecture of the GatewayD and plugins to install.
# Default: amd64
# Possible values: amd64 or arm64
# - ARCH=amd64
- REDIS_URL=redis://redis:6379/0
write-postgres:
image: postgres:latest
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
read-postgres:
image: postgres:latest
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:latest
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
gatewayd:
image: gatewaydio/gatewayd:latest
command:
[
"run",
"--config",
"/gatewayd-files/gatewayd.yaml",
"--plugin-config",
"/gatewayd-files/gatewayd_plugins.yaml",
"--tracing",
"--collector-url",
"tempo:4317",
]
pull_policy: always
environment:
# For more information about the environment variables, see:
# https://docs.gatewayd.io/using-gatewayd/configuration#environment-variables
- GATEWAYD_CLIENTS_DEFAULT_WRITES_ADDRESS=write-postgres:5432
- GATEWAYD_CLIENTS_DEFAULT_READS_ADDRESS=read-postgres:5432
# - GATEWAYD_LOGGERS_DEFAULT_LEVEL=debug
ports:
# GatewayD server for PostgreSQL clients to connect to
- "15432:15432"
# Prometheus metrics:
# http://localhost:9090/metrics # Make sure the port is not used by prometheus before uncommenting the following line
# - "9090:9090"
# GatewayD HTTP gateway:
# http://localhost:18080/swagger-ui/ for the API documentation
# http://localhost:18080/healthz for the health check
- "18080:18080"
# GatewayD gRPC API with reflection enabled:
# You can use grpcurl or grpc-client-cli to interact with it
- "19090:19090"
volumes:
- ./gatewayd-files:/gatewayd-files:ro
links:
- write-postgres
- read-postgres
- redis
healthcheck:
test: ["CMD", "curl", "-f", "http://gatewayd:18080/healthz"]
interval: 5s
timeout: 5s
retries: 5
depends_on:
write-postgres:
condition: service_healthy
read-postgres:
condition: service_healthy
redis:
condition: service_healthy
install_plugins:
condition: service_completed_successfully
prometheus:
image: prom/prometheus:latest
volumes:
- ./observability-configs/prometheus.yaml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
depends_on:
- gatewayd
tempo_init:
image: &tempoImage grafana/tempo:latest
user: root
entrypoint:
- "chown"
- "10001:10001"
- "/var/tempo"
volumes:
- ./tempo-data:/var/tempo
tempo:
image: *tempoImage
command: ["-config.file=/etc/tempo.yaml"]
volumes:
- ./observability-configs/tempo.yaml:/etc/tempo.yaml
- ./tempo-data:/var/tempo
ports:
- "4317:4317" # otlp grpc
depends_on:
- tempo_init
grafana:
image: grafana/grafana:latest
volumes:
- ./observability-configs/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_DISABLE_LOGIN_FORM=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
ports:
- "3000:3000"
depends_on:
- prometheus
- tempo