-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (64 loc) · 2.55 KB
/
Copy pathdocker-compose.yml
File metadata and controls
71 lines (64 loc) · 2.55 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
# Docker Compose for the Linear coding agent.
#
# Quick start:
# 1. Copy .env.example to .env and fill in the secrets.
# 2. Set MATTERAI_API_KEY in .env (required - the container will refuse
# to start without it).
# 3. docker compose up -d
# 4. docker compose logs -f agent
#
# Required env (in .env):
# MATTERAI_API_KEY - orbcode's API key
# LINEAR_API_KEY - Linear personal API key
# LINEAR_WEBHOOK_SECRET - Linear webhook signing secret
# GITHUB_TOKEN - GitHub PAT (repo scope)
#
# Optional env (in .env):
# PORT - host port to expose (default 3000)
# LINEAR_BOT_USER_ID - the agent's Linear user id, so it ignores its
# own comment (avoids answer loops)
# ORBCODE_DEFAULT_MODEL - fallback model if the ticket doesn't specify
# ORBCODE_TIMEOUT_SECONDS - per-job wall clock cap (default 3600)
# REQUIRE_TESTS - true|false (default true)
# INTERNAL_TOKEN - required to call /jobs/* from outside
services:
agent:
build:
context: .
dockerfile: Dockerfile
image: linear-coding-agent:latest
container_name: linear-coding-agent
restart: unless-stopped
# Load non-secret config from .env first.
env_file:
- .env
# MATTERAI_API_KEY is required for orbcode. The `${VAR:?msg}` syntax
# in Compose makes the file fail to load with a clear error if the
# variable is unset, instead of starting a container that immediately
# fails when orbcode tries to authenticate.
environment:
- MATTERAI_API_KEY=${MATTERAI_API_KEY:?MATTERAI_API_KEY must be set in .env - get one from https://matterai.so}
# Expose the webhook receiver on the host.
ports:
- "${PORT:-3000}:3000"
# Persist job state and worktrees across container restarts. The
# agent writes everything under $DATA_DIR (default /data) so a
# single bind mount covers both `jobs.json` and the per-job worktrees.
volumes:
- ./data:/data
# The container itself is healthy iff /health returns 200. This is
# also a useful `docker compose ps` signal.
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:3000/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
# If you put the agent behind a reverse proxy (Caddy, nginx, Cloudflare
# Tunnel) you can remove the `ports:` mapping and add a network.
# networks:
# - agent-net
#
# networks:
# agent-net:
# driver: bridge