mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-12 23:29:16 +03:00
Co-authored-by: yu-xin-c <175149126+yu-xin-c@users.noreply.github.com>
63 lines
1.4 KiB
YAML
63 lines
1.4 KiB
YAML
x-common-config: &common-config
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
args:
|
|
NANOBOT_CHANNELS: ${NANOBOT_CHANNELS:-whatsapp}
|
|
volumes:
|
|
- ~/.nanobot:/home/nanobot/.nanobot
|
|
cap_drop:
|
|
- ALL
|
|
# Entrypoint uses these to fix bind-mount ownership and drop to the nanobot user.
|
|
cap_add:
|
|
- CHOWN
|
|
- SETGID
|
|
- SETUID
|
|
# Prevent the non-root process from regaining capabilities through setuid
|
|
# binaries or file capabilities left inside the container image.
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
|
|
services:
|
|
nanobot-gateway:
|
|
container_name: nanobot-gateway
|
|
<<: *common-config
|
|
command: ["gateway"]
|
|
restart: unless-stopped
|
|
ports:
|
|
- 127.0.0.1:18790:18790
|
|
- 8765:8765
|
|
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", "/home/nanobot/.nanobot/api-workspace"]
|
|
restart: unless-stopped
|
|
ports:
|
|
- 127.0.0.1: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
|