|
| 1 | +# Production Docker Compose for hosted coven-github: adapter + TLS ingress |
| 2 | +# (Caddy) + continuous SQLite replication (Litestream → Cloudflare R2). |
| 3 | +# |
| 4 | +# Runbook: docs/hosted-deploy.md. Secrets come from ./.env (never committed); |
| 5 | +# copy .env.example and fill it in. |
| 6 | +# |
| 7 | +# Layout on the host (created by provision.sh): |
| 8 | +# /opt/coven-github/ |
| 9 | +# compose.yaml this file |
| 10 | +# .env secrets (mode 0600) |
| 11 | +# Caddyfile TLS ingress |
| 12 | +# litestream.yml replication config |
| 13 | +# config/production.toml adapter config |
| 14 | +# keys/app.pem GitHub App private key (mode 0600) |
| 15 | +# data/ SQLite store (replicated) |
| 16 | + |
| 17 | +services: |
| 18 | + coven-github: |
| 19 | + image: ghcr.io/opencoven/coven-github:${COVEN_GITHUB_TAG:-latest} |
| 20 | + command: ["serve", "--config", "/config/production.toml"] |
| 21 | + restart: unless-stopped |
| 22 | + expose: |
| 23 | + - "3000" |
| 24 | + volumes: |
| 25 | + - ./config:/config:ro |
| 26 | + - ./keys:/keys:ro |
| 27 | + - ./data:/data |
| 28 | + - ./workspaces:/tmp/coven-github-tasks |
| 29 | + # Container worker backend: the adapter launches per-task hardened |
| 30 | + # containers through the host Docker daemon (docs/container-isolation.md). |
| 31 | + - /var/run/docker.sock:/var/run/docker.sock |
| 32 | + # The image runs unprivileged (uid 10001); grant the host docker group so |
| 33 | + # the worker can drive the daemon. provision.sh fills DOCKER_GID in .env. |
| 34 | + group_add: |
| 35 | + - "${DOCKER_GID:?set in .env (getent group docker | cut -d: -f3)}" |
| 36 | + environment: |
| 37 | + RUST_LOG: "coven_github=info" |
| 38 | + healthcheck: |
| 39 | + test: ["CMD", "curl", "-fsS", "http://localhost:3000/healthz"] |
| 40 | + interval: 30s |
| 41 | + timeout: 5s |
| 42 | + retries: 3 |
| 43 | + start_period: 10s |
| 44 | + |
| 45 | + caddy: |
| 46 | + image: caddy:2 |
| 47 | + restart: unless-stopped |
| 48 | + ports: |
| 49 | + - "80:80" |
| 50 | + - "443:443" |
| 51 | + volumes: |
| 52 | + - ./Caddyfile:/etc/caddy/Caddyfile:ro |
| 53 | + - caddy-data:/data |
| 54 | + - caddy-config:/config |
| 55 | + environment: |
| 56 | + WEBHOOK_DOMAIN: ${WEBHOOK_DOMAIN:?set in .env, e.g. gh.opencoven.ai} |
| 57 | + depends_on: |
| 58 | + - coven-github |
| 59 | + |
| 60 | + litestream: |
| 61 | + image: litestream/litestream:0.3 |
| 62 | + restart: unless-stopped |
| 63 | + command: ["replicate", "-config", "/etc/litestream.yml"] |
| 64 | + volumes: |
| 65 | + - ./litestream.yml:/etc/litestream.yml:ro |
| 66 | + - ./data:/data |
| 67 | + environment: |
| 68 | + LITESTREAM_ACCESS_KEY_ID: ${R2_ACCESS_KEY_ID:?set in .env} |
| 69 | + LITESTREAM_SECRET_ACCESS_KEY: ${R2_SECRET_ACCESS_KEY:?set in .env} |
| 70 | + R2_BUCKET: ${R2_BUCKET:?set in .env} |
| 71 | + R2_ACCOUNT_ID: ${R2_ACCOUNT_ID:?set in .env} |
| 72 | + depends_on: |
| 73 | + - coven-github |
| 74 | + |
| 75 | +volumes: |
| 76 | + caddy-data: |
| 77 | + caddy-config: |
0 commit comments