Skip to content

Commit 93f14dc

Browse files
feat: run core stack without a tunnel token
Move cloudflared into an optional compose.tunnel.yml overlay (pinned to 2026.6.1 instead of :latest) so a fresh clone + .env.example + 'just up' brings up Grafana locally. 'just up-tunnel' is the production path.
1 parent 39f7d5c commit 93f14dc

4 files changed

Lines changed: 28 additions & 13 deletions

File tree

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ GRAFANA_ADMIN_PASSWORD=change-me
66
# GRAFANA_ROOT_URL=https://grafana.example.com
77
GRAFANA_ROOT_URL=http://localhost:3000
88

9+
# Only needed for `just up-tunnel` (production exposure via Cloudflare Tunnel).
910
# From: Cloudflare Zero Trust → Networks → Tunnels → <your tunnel> → Configure → token
1011
CLOUDFLARE_TUNNEL_TOKEN=

compose.tunnel.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Production overlay: expose Grafana (and the OTLP endpoints) via Cloudflare
2+
# Tunnel. Requires CLOUDFLARE_TUNNEL_TOKEN in .env.
3+
#
4+
# just up-tunnel
5+
#
6+
# Token-based tunnel: routes are configured in the Cloudflare Zero Trust
7+
# dashboard. Create a tunnel at dash.cloudflare.com → Zero Trust → Networks →
8+
# Tunnels, then set the public hostnames there (e.g. grafana.example.com →
9+
# http://grafana:3000, otlp.example.com → http://otel-collector:4318).
10+
11+
services:
12+
cloudflared:
13+
image: cloudflare/cloudflared:2026.6.1
14+
restart: unless-stopped
15+
depends_on: [ grafana, otel-collector ]
16+
command: tunnel --no-autoupdate run --token ${CLOUDFLARE_TUNNEL_TOKEN:?set CLOUDFLARE_TUNNEL_TOKEN in .env}
17+
logging:
18+
driver: json-file
19+
options:
20+
max-size: "10m"
21+
max-file: "3"

compose.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,6 @@ services:
8282
GF_FEATURE_TOGGLES_ENABLE: traceqlEditor,metricsSummary,traceToProfiles
8383
logging: *default-logging
8484

85-
cloudflared:
86-
image: cloudflare/cloudflared:latest
87-
restart: unless-stopped
88-
depends_on: [ grafana, otel-collector ]
89-
# Token-based tunnel: routes are configured in the Cloudflare Zero Trust dashboard.
90-
# Create a tunnel at dash.cloudflare.com → Zero Trust → Networks → Tunnels,
91-
# then set the public hostnames there (e.g. grafana.example.com → http://grafana:3000,
92-
# otlp.example.com → http://otel-collector:4318).
93-
command: tunnel --no-autoupdate run --token ${CLOUDFLARE_TUNNEL_TOKEN:?set CLOUDFLARE_TUNNEL_TOKEN in .env}
94-
logging: *default-logging
95-
pull_policy: always
96-
9785
volumes:
9886
loki_data:
9987
tempo_data:

justfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@ set dotenv-load
33
default:
44
@just --list
55

6+
# Core stack (no tunnel; Grafana at http://localhost:3000)
67
up:
78
docker compose up -d
89

10+
# Core stack + Cloudflare Tunnel (production; needs CLOUDFLARE_TUNNEL_TOKEN)
11+
up-tunnel:
12+
docker compose -f compose.yml -f compose.tunnel.yml up -d
13+
914
down:
10-
docker compose down
15+
docker compose down --remove-orphans
1116

1217
logs service="":
1318
docker compose logs -f {{service}}

0 commit comments

Comments
 (0)