Repository navigation
Expand file tree
/
Copy pathcompose.yml
More file actions
75 lines (72 loc) · 2.76 KB
/
Copy pathcompose.yml
File metadata and controls
75 lines (72 loc) · 2.76 KB
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
# Kazari for local development and testing: the image built from
# deploy/Dockerfile, run with serve --local (plain HTTP, base domain
# localhost, data in a named volume). deploy/compose.yml is the one for a
# real server.
#
# docker compose up --build -d # start; pages at http://<slug>.localhost:8080/
# docker compose logs -f # follow the server log
# docker compose watch # rebuild and restart when the source changes
# docker compose down # stop; add -v to discard the data too
#
# The admin commands run inside the container over the admin socket, so they
# need no token; then publish from the host with the key:
# docker compose exec kazari kazari admin users create peter --role admin
# docker compose exec kazari kazari admin keys issue peter --label laptop
# KAZARI_URL=http://api.localhost:8080 KAZARI_TOKEN=kzk_... go run ./cmd/kazari publish ./site --slug demo
#
# A ./.env (start from deploy/kazari.env.example) is passed into the container
# for KAZARI_* overrides.
#
# The telemetry profile adds Grafana with Tempo, Prometheus and Loki behind
# an OpenTelemetry Collector, at http://localhost:3000/:
# export KAZARI_TELEMETRY_OTLP_ENDPOINT=http://lgtm:4318 KAZARI_TELEMETRY_METRICS_OTLP=true KAZARI_TELEMETRY_LOGS_OTLP=true
# docker compose --profile telemetry up --build -d
services:
kazari:
build:
context: .
dockerfile: deploy/Dockerfile
image: kazari:dev
command: ["serve", "--local"]
ports:
# Loopback only: *.localhost resolves to both 127.0.0.1 and ::1.
- "127.0.0.1:8080:8080"
- "[::1]:8080:8080"
volumes:
- data:/var/lib/kazari
env_file:
- path: .env
required: false
environment:
# --local binds loopback; inside the container the published port
# must listen on every interface (the ports above stay on loopback).
KAZARI_LISTEN_HTTP: ":8080"
KAZARI_TELEMETRY_OTLP_ENDPOINT: ${KAZARI_TELEMETRY_OTLP_ENDPOINT:-}
KAZARI_TELEMETRY_METRICS_OTLP: ${KAZARI_TELEMETRY_METRICS_OTLP:-false}
KAZARI_TELEMETRY_LOGS_OTLP: ${KAZARI_TELEMETRY_LOGS_OTLP:-false}
KAZARI_TELEMETRY_TRACES_SITE_SAMPLE_RATIO: ${KAZARI_TELEMETRY_TRACES_SITE_SAMPLE_RATIO:-0.01}
healthcheck:
# Over the admin socket in the data volume, which needs no token.
test: ["CMD", "/usr/local/bin/kazari", "admin", "health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
start_interval: 1s
develop:
watch:
- action: rebuild
path: .
ignore:
- .data/
- .git/
- docs/
- site/
- "*.md"
lgtm:
image: grafana/otel-lgtm:0.38.1
profiles: [telemetry]
ports:
- "127.0.0.1:3000:3000"
volumes:
data: