Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml.example
More file actions
85 lines (82 loc) · 3.65 KB
/
Copy pathdocker-compose.yml.example
File metadata and controls
85 lines (82 loc) · 3.65 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
76
77
78
79
80
81
82
83
84
85
# Production-ready compose template and local-dev convenience. Either
# pull the published image (`docker compose pull && docker compose up`)
# or build from the working copy (`docker compose up --build`) — the
# `image:` and `build:` lines below cover both flows from one file.
#
# Defaults are tuned for local development with agents:
# - compose publishes the container's port on 127.0.0.1 only
# (so only this host can reach kata; KATA_PUBLISH_ADDR below)
# - the binary's default auth mode (trust-client) honours
# X-Review-Author / ?as= so Claude Code via MCP works out of the
# box on the same host
#
# Naming note: KATA_PUBLISH_ADDR / KATA_PUBLISH_PORT fill the host
# side of compose's HOST_IP:HOST_PORT:CONTAINER_PORT port-forward
# mapping. The container itself always binds 0.0.0.0:7878 inside,
# set by KATA_BIND in the Dockerfile — the two are independent.
#
# For a deployment beyond a single user, set KATA_PUBLISH_ADDR=0.0.0.0
# **and** a real KATA_AUTH_MODE in .env (plus TLS / OIDC params as
# needed). See docs/deploying.md for the full menu.
#
# Required env: KATA_WORKSPACES_DIR (host dir of jj repos to serve).
# All other knobs are optional — see .env.example.
#
# docker compose up # production-style serve
# docker compose up --build # rebuild from working copy
# docker compose --profile demo up # zero-config guided tour
# docker compose --profile demo up --build # demo on local sources
services:
kata:
image: ${KATA_IMAGE:-ghcr.io/martint/kata:latest}
build:
context: .
dockerfile: Dockerfile
# Run the container as the host user so files written to /data
# and /workspaces are owned by you, not root. Defaults to
# `0:0` (root) when unset — see .env.example for how to wire
# KATA_UID / KATA_GID to your actual host UID / GID.
user: "${KATA_UID:-0}:${KATA_GID:-0}"
ports:
- "${KATA_PUBLISH_ADDR:-127.0.0.1}:${KATA_PUBLISH_PORT:-7878}:7878"
volumes:
# Bare token = the named volume below; a path = bind mount.
# Unset → managed `kata-data` volume (production default). Set
# KATA_DATA_DIR=${HOME}/kata to keep state on the host filesystem.
- "${KATA_DATA_DIR:-kata-data}:/data"
- "${KATA_WORKSPACES_DIR:?set KATA_WORKSPACES_DIR to a host dir of jj repos}:/workspaces:rw"
# GitHub PR integration: reuse the host's `gh auth login`
# read-only. The default image ships `gh` + `git`; kata stores
# no credentials of its own, so it rides on this mounted login
# (git fetch of a PR head routes through gh's token too). Pair
# with GH_CONFIG_DIR below. See docs/deploying.md §GitHub.
# - "${HOME}/.config/gh:/gh:ro"
# SSH-remote workspaces additionally need a key for the fetch:
# - "${HOME}/.ssh:/home/kata/.ssh:ro"
command: ["serve", "--workspace", "*=/workspaces"]
env_file:
- path: .env
required: false
environment:
KATA_AUTHOR: ${KATA_AUTHOR:-dev@localhost}
RUST_LOG: ${RUST_LOG:-info}
# Points `gh` at the mounted host login above. Leave unset if
# you're not using the GitHub PR integration.
# GH_CONFIG_DIR: /gh
# `docker compose --profile demo up` — seeded workspace + ?demo=1
# guided tour at http://localhost:7878. No host repo dir needed.
kata-demo:
profiles: [demo]
image: ${KATA_IMAGE:-ghcr.io/martint/kata:latest}
build:
context: .
dockerfile: Dockerfile
user: "${KATA_UID:-0}:${KATA_GID:-0}"
ports:
- "${KATA_PUBLISH_ADDR:-127.0.0.1}:${KATA_PUBLISH_PORT:-7878}:7878"
volumes:
- kata-demo-data:/data
command: ["demo"]
volumes:
kata-data:
kata-demo-data: