nanobot/docker-compose.yml
dengjingren d99331ad31 feat(docker): add nanobot-api service with isolated workspace
- Add nanobot-api service (OpenAI-compatible HTTP API on port 8900)
- Uses isolated workspace (/root/.nanobot/api-workspace) to avoid
  session/memory conflicts with nanobot-gateway

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 16:20:20 +08:00

56 lines
1.0 KiB
YAML

x-common-config: &common-config
build:
context: .
dockerfile: Dockerfile
volumes:
- ~/.nanobot:/home/nanobot/.nanobot
cap_drop:
- ALL
cap_add:
- SYS_ADMIN
security_opt:
- apparmor=unconfined
- seccomp=unconfined
services:
nanobot-gateway:
container_name: nanobot-gateway
<<: *common-config
command: ["gateway"]
restart: unless-stopped
ports:
- 18790:18790
deploy:
resources:
limits:
cpus: "1"
memory: 1G
reservations:
cpus: "0.25"
memory: 256M
nanobot-api:
container_name: nanobot-api
<<: *common-config
command:
["serve", "--host", "0.0.0.0", "-w", "/root/.nanobot/api-workspace"]
restart: unless-stopped
ports:
- 8900:8900
deploy:
resources:
limits:
cpus: "1"
memory: 1G
reservations:
cpus: "0.25"
memory: 256M
nanobot-cli:
<<: *common-config
profiles:
- cli
command: ["status"]
stdin_open: true
tty: true