diff --git a/docs/deployment/PRODUCTION.md b/docs/deployment/PRODUCTION.md index 04e847a..eae9684 100644 --- a/docs/deployment/PRODUCTION.md +++ b/docs/deployment/PRODUCTION.md @@ -52,89 +52,31 @@ cp config/default.yaml config/production.yaml # Edit config/production.yaml with your settings # Start services -docker-compose up -d +docker compose up -d # View logs -docker-compose logs -f +docker compose logs -f ``` ### Dockerfile -The multi-stage Dockerfile: +Use the repo Dockerfile: `Dockerfile`. -```dockerfile -# Stage 1: Build -FROM node:22-alpine AS builder -WORKDIR /app -COPY package*.json ./ -RUN npm ci --only=production -COPY . . -RUN npm run build +Notes: -# Stage 2: Runtime -FROM node:22-alpine -WORKDIR /app -COPY --from=builder /app/dist ./dist -COPY --from=builder /app/node_modules ./node_modules -COPY config ./config -COPY src/gateway/ui ./dist/gateway/ui - -# Create data directory -RUN mkdir -p /data - -# Health check -HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD node -e "require('http').get('http://localhost:18800/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})" - -# Expose gateway port -EXPOSE 18800 - -# Run -CMD ["node", "dist/cli/index.js", "start"] -``` +- Multi-stage build (builder + runtime). +- Uses `corepack` + `pnpm` with `pnpm-lock.yaml` for reproducible installs. +- Exposes port `18800` and runs `dist/cli/index.js start`. ### Docker Compose Configuration -```yaml -version: '3.8' +Use the repo compose file: `docker-compose.yml`. -services: - flynn: - build: . - container_name: flynn - restart: unless-stopped - ports: - - "18800:18800" - volumes: - - ./config/production.yaml:/flynn/config.yaml:ro - - flynn_data:/data - - /var/run/docker.sock:/var/run/docker.sock # For sandbox - environment: - - NODE_ENV=production - - FLYNN_CONFIG=/flynn/config.yaml - healthcheck: - test: ["CMD", "wget", "--spider", "-q", "http://localhost:18800/health"] - interval: 30s - timeout: 10s - retries: 3 - start_period: 5s +The important parts to customize: - whisper: - image: openai/whisper-server:latest - container_name: whisper-server - restart: unless-stopped - ports: - - "8080:8080" - volumes: - - whisper_cache:/cache - environment: - - WHISPER_MODEL=base - - WHISPER_HTTP_PORT=8080 - -volumes: - flynn_data: - whisper_cache: -``` +- Mount your config: `./config/production.yaml:/config/config.yaml:ro` +- Set provider keys (`ANTHROPIC_API_KEY`, etc.) +- Optionally set gateway token auth (`FLYNN_SERVER_TOKEN`) ### Environment Variables @@ -264,8 +206,9 @@ Never commit secrets to version control. Use one of these approaches: # config/production.yaml models: default: - anthropic: - apiKey: '${ANTHROPIC_API_KEY}' + provider: anthropic + model: claude-sonnet-4-20250514 + api_key: '${ANTHROPIC_API_KEY}' ``` Set in `/etc/flynn/.env` or systemd service file: diff --git a/docs/plans/state.json b/docs/plans/state.json index 7edae87..1237ef3 100644 --- a/docs/plans/state.json +++ b/docs/plans/state.json @@ -19,6 +19,11 @@ "date": "2026-02-15", "summary": "Docs fix: updated docs/api/PROTOCOL.md and docs/deployment/PRODUCTION.md to use the current config schema keys for gateway auth (server.token/server.tailscale_identity/server.auth_http) and added a short safe-defaults snippet (pairing/tools.profile/sandbox)." }, + "docs-production-guide-reality-check": { + "status": "completed", + "date": "2026-02-15", + "summary": "Docs fix: updated docs/deployment/PRODUCTION.md to match the repo's actual Dockerfile (pnpm/corepack) and docker-compose.yml, and corrected the config YAML snippet to use models.default.provider/model/api_key per the current config schema." + }, "openclaw-gap-roadmap": { "file": "2026-02-15-openclaw-gap-roadmap.md", "status": "planned",