docs(deployment): align production guide with repo Dockerfile/compose and schema
This commit is contained in:
@@ -52,89 +52,31 @@ cp config/default.yaml config/production.yaml
|
|||||||
# Edit config/production.yaml with your settings
|
# Edit config/production.yaml with your settings
|
||||||
|
|
||||||
# Start services
|
# Start services
|
||||||
docker-compose up -d
|
docker compose up -d
|
||||||
|
|
||||||
# View logs
|
# View logs
|
||||||
docker-compose logs -f
|
docker compose logs -f
|
||||||
```
|
```
|
||||||
|
|
||||||
### Dockerfile
|
### Dockerfile
|
||||||
|
|
||||||
The multi-stage Dockerfile:
|
Use the repo Dockerfile: `Dockerfile`.
|
||||||
|
|
||||||
```dockerfile
|
Notes:
|
||||||
# Stage 1: Build
|
|
||||||
FROM node:22-alpine AS builder
|
|
||||||
WORKDIR /app
|
|
||||||
COPY package*.json ./
|
|
||||||
RUN npm ci --only=production
|
|
||||||
COPY . .
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
# Stage 2: Runtime
|
- Multi-stage build (builder + runtime).
|
||||||
FROM node:22-alpine
|
- Uses `corepack` + `pnpm` with `pnpm-lock.yaml` for reproducible installs.
|
||||||
WORKDIR /app
|
- Exposes port `18800` and runs `dist/cli/index.js start`.
|
||||||
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"]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Docker Compose Configuration
|
### Docker Compose Configuration
|
||||||
|
|
||||||
```yaml
|
Use the repo compose file: `docker-compose.yml`.
|
||||||
version: '3.8'
|
|
||||||
|
|
||||||
services:
|
The important parts to customize:
|
||||||
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
|
|
||||||
|
|
||||||
whisper:
|
- Mount your config: `./config/production.yaml:/config/config.yaml:ro`
|
||||||
image: openai/whisper-server:latest
|
- Set provider keys (`ANTHROPIC_API_KEY`, etc.)
|
||||||
container_name: whisper-server
|
- Optionally set gateway token auth (`FLYNN_SERVER_TOKEN`)
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- "8080:8080"
|
|
||||||
volumes:
|
|
||||||
- whisper_cache:/cache
|
|
||||||
environment:
|
|
||||||
- WHISPER_MODEL=base
|
|
||||||
- WHISPER_HTTP_PORT=8080
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
flynn_data:
|
|
||||||
whisper_cache:
|
|
||||||
```
|
|
||||||
|
|
||||||
### Environment Variables
|
### Environment Variables
|
||||||
|
|
||||||
@@ -264,8 +206,9 @@ Never commit secrets to version control. Use one of these approaches:
|
|||||||
# config/production.yaml
|
# config/production.yaml
|
||||||
models:
|
models:
|
||||||
default:
|
default:
|
||||||
anthropic:
|
provider: anthropic
|
||||||
apiKey: '${ANTHROPIC_API_KEY}'
|
model: claude-sonnet-4-20250514
|
||||||
|
api_key: '${ANTHROPIC_API_KEY}'
|
||||||
```
|
```
|
||||||
|
|
||||||
Set in `/etc/flynn/.env` or systemd service file:
|
Set in `/etc/flynn/.env` or systemd service file:
|
||||||
|
|||||||
@@ -19,6 +19,11 @@
|
|||||||
"date": "2026-02-15",
|
"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)."
|
"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": {
|
"openclaw-gap-roadmap": {
|
||||||
"file": "2026-02-15-openclaw-gap-roadmap.md",
|
"file": "2026-02-15-openclaw-gap-roadmap.md",
|
||||||
"status": "planned",
|
"status": "planned",
|
||||||
|
|||||||
Reference in New Issue
Block a user