Skip to content

Commit b371613

Browse files
authored
chore: fix docker-composes (Envoy not starting) (#3056)
## Description They started failing after this line changed https://github.com/authzed/spicedb/blame/main/Dockerfile#L11 ## Testing `docker-compose -f docker-compose.pgbouncer.yaml up --build` - you should see all containers come up (previously Envoy was failing)
1 parent fb53af0 commit b371613

7 files changed

Lines changed: 388 additions & 9 deletions

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/g
88

99
# use `docker buildx imagetools inspect <image>` to get the multi-platform sha256
1010
FROM cgr.dev/chainguard/static@sha256:99a5f826e71115aef9f63368120a6aa518323e052297718e9bf084fb84def93c
11-
COPY --from=ghcr.io/grpc-ecosystem/grpc-health-probe:v0.4.48 /ko-app/grpc-health-probe /usr/local/bin/grpc_health_probe
11+
# NOTE: the copy target location differs from Dockerfile.release for historical reasons. It's referenced in
12+
# compose files and elsewhere so we're keeping it the way it is.
13+
COPY --from=ghcr.io/grpc-ecosystem/grpc-health-probe:v0.4.48 /ko-app/grpc-health-probe /bin/grpc_health_probe
1214
COPY --from=spicedb-builder /go/src/app/spicedb /usr/local/bin/spicedb
1315
ENV PATH="$PATH:/usr/local/bin"
1416
EXPOSE 50051

docker-compose.memdb.yaml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
# FOR DEVELOPMENT ONLY
3+
# docker-compose -f docker-compose.memdb.yaml up --build
4+
services:
5+
spicedb-1:
6+
container_name: "spicedb-1"
7+
build: "."
8+
command: "serve"
9+
restart: "no"
10+
ports:
11+
- "50051:50051" # grpc endpoint
12+
- "8443:8443" # http endpoint
13+
- "9090:9090" # prometheus metrics
14+
environment:
15+
- "SPICEDB_LOG_FORMAT=json"
16+
- "SPICEDB_LOG_LEVEL=info"
17+
- "SPICEDB_HTTP_ENABLED=true"
18+
- "SPICEDB_GRPC_PRESHARED_KEY=super-secret-key"
19+
- "SPICEDB_DATASTORE_ENGINE=memory"
20+
- "SPICEDB_OTEL_PROVIDER=otlpgrpc"
21+
- "SPICEDB_OTEL_SAMPLE_RATIO=1"
22+
- "SPICEDB_TELEMETRY_ENDPOINT="
23+
- "SPICEDB_GRPC_LOG_REQUESTS_ENABLED=false"
24+
- "SPICEDB_GRPC_LOG_RESPONSES_ENABLED=false"
25+
- "SPICEDB_STREAMING_API_RESPONSE_DELAY_TIMEOUT=0s"
26+
- "OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317"
27+
- "SPICEDB_ENABLE_PERFORMANCE_INSIGHT_METRICS=true"
28+
depends_on:
29+
otel-collector:
30+
condition: "service_started"
31+
healthcheck:
32+
test: ["CMD", "/bin/grpc_health_probe", "-addr=localhost:50051"]
33+
interval: "5s"
34+
timeout: "30s"
35+
retries: 3
36+
prometheus:
37+
image: "prom/prometheus:v2.47.0"
38+
command:
39+
- "--config.file=/etc/prometheus/prometheus.yaml"
40+
- "--storage.tsdb.path=/prometheus"
41+
- "--enable-feature=native-histograms"
42+
volumes:
43+
- "./development/prometheus.yaml:/etc/prometheus/prometheus.yaml"
44+
ports:
45+
- "9091:9090" # Prometheus UI
46+
restart: "unless-stopped"
47+
otel-collector:
48+
image: "otel/opentelemetry-collector:0.60.0"
49+
command: "--config /etc/otel-config.yaml"
50+
volumes:
51+
- "./development/otel-config.yaml:/etc/otel-config.yaml"
52+
ports:
53+
- "4317:4317" # OTLP gRPC
54+
- "8888" # Prometheus metrics for collector
55+
depends_on:
56+
- "tempo"
57+
loki:
58+
image: "grafana/loki:2.9.0"
59+
command: "-config.file=/etc/loki/loki.yaml"
60+
volumes:
61+
- "./development/loki.yaml:/etc/loki/loki.yaml"
62+
ports:
63+
- "3100" # Loki API
64+
restart: "unless-stopped"
65+
tempo:
66+
image: "grafana/tempo:1.5.0"
67+
command: "-search.enabled=true -config.file=/etc/tempo.yaml"
68+
volumes:
69+
- "./development/tempo.yaml:/etc/tempo.yaml"
70+
restart: "unless-stopped"
71+
ports:
72+
- "4317" # OTLP gRPC
73+
- "3100" # tempo
74+
grafana:
75+
image: "grafana/grafana:9.1.5-ubuntu"
76+
volumes:
77+
- "./development/grafana/provisioning/datasources:/etc/grafana/provisioning/datasources"
78+
- "./development/grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards"
79+
- "./development/grafana/dashboards:/etc/grafana/dashboards"
80+
environment:
81+
- "GF_AUTH_ANONYMOUS_ENABLED=true"
82+
- "GF_AUTH_ANONYMOUS_ORG_ROLE=Admin"
83+
- "GF_AUTH_DISABLE_LOGIN_FORM=true"
84+
ports:
85+
- "3000:3000" # UI
86+
depends_on:
87+
- "tempo"
88+
- "prometheus"
89+
- "loki"

docker-compose.mysql.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ services:
6868
- "SPICEDB_LOG_FORMAT=json"
6969
- "SPICEDB_LOG_LEVEL=info"
7070
- "SPICEDB_HTTP_ENABLED=true"
71-
- "SPICEDB_GRPC_PRESHARED_KEY=foobar"
71+
- "SPICEDB_GRPC_PRESHARED_KEY=super-secret-key"
7272
- "SPICEDB_DATASTORE_ENGINE=mysql"
7373
- "SPICEDB_DATASTORE_CONN_URI=root:secret@(mysql:3306)/spicedb?parseTime=true"
7474
- "SPICEDB_DISPATCH_CLUSTER_ENABLED=true"
@@ -105,7 +105,7 @@ services:
105105
- "SPICEDB_LOG_FORMAT=json"
106106
- "SPICEDB_LOG_LEVEL=info"
107107
- "SPICEDB_HTTP_ENABLED=true"
108-
- "SPICEDB_GRPC_PRESHARED_KEY=foobar"
108+
- "SPICEDB_GRPC_PRESHARED_KEY=super-secret-key"
109109
- "SPICEDB_DATASTORE_ENGINE=mysql"
110110
- "SPICEDB_DATASTORE_CONN_URI=root:secret@(mysql:3306)/spicedb?parseTime=true"
111111
- "SPICEDB_DISPATCH_CLUSTER_ENABLED=true"

0 commit comments

Comments
 (0)