From c03f2b670bda14557a75e77865b8a89a6670c409 Mon Sep 17 00:00:00 2001 From: Rajasimman S Date: Tue, 17 Feb 2026 18:50:03 +0530 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=B3=20feat:=20add=20Docker=20Compo?= =?UTF-8?q?se=20support=20for=20easy=20deployment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add docker-compose.yml with gateway and CLI services, resource limits, and comprehensive documentation for Docker Compose usage. --- README.md | 33 +++++++++++++++++++++++++++++++++ docker-compose.yml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 docker-compose.yml diff --git a/README.md b/README.md index 0e20449..f5a92fd 100644 --- a/README.md +++ b/README.md @@ -811,6 +811,39 @@ nanobot cron remove > [!TIP] > The `-v ~/.nanobot:/root/.nanobot` flag mounts your local config directory into the container, so your config and workspace persist across container restarts. +### Using Docker Compose (Recommended) + +The easiest way to run nanobot with Docker: + +```bash +# 1. Initialize config (first time only) +docker compose run --rm nanobot-cli onboard + +# 2. Edit config to add API keys +vim ~/.nanobot/config.json + +# 3. Start gateway service +docker compose up -d nanobot-gateway + +# 4. Check logs +docker compose logs -f nanobot-gateway + +# 5. Run CLI commands +docker compose run --rm nanobot-cli status +docker compose run --rm nanobot-cli agent -m "Hello!" + +# 6. Stop services +docker compose down +``` + +**Features:** +- ✅ Resource limits (1 CPU, 1GB memory) +- ✅ Auto-restart on failure +- ✅ Shared configuration using YAML anchors +- ✅ Separate CLI profile for on-demand commands + +### Using Docker directly + Build and run nanobot in a container: ```bash diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..446f5e3 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,32 @@ +x-common-config: &common-config + build: + context: . + dockerfile: Dockerfile + volumes: + - ~/.nanobot:/root/.nanobot + +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-cli: + container_name: nanobot-cli + <<: *common-config + profiles: + - cli + command: ["status"] + stdin_open: true + tty: true From aad1df5b9b13f8bd0e233af7cc26cc47e0615ff4 Mon Sep 17 00:00:00 2001 From: Re-bin Date: Tue, 17 Feb 2026 17:55:48 +0000 Subject: [PATCH 2/2] Simplify Docker Compose docs and remove fixed CLI container name --- README.md | 39 ++++++++++----------------------------- docker-compose.yml | 1 - 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index f5a92fd..96ff557 100644 --- a/README.md +++ b/README.md @@ -811,40 +811,21 @@ nanobot cron remove > [!TIP] > The `-v ~/.nanobot:/root/.nanobot` flag mounts your local config directory into the container, so your config and workspace persist across container restarts. -### Using Docker Compose (Recommended) - -The easiest way to run nanobot with Docker: +### Docker Compose ```bash -# 1. Initialize config (first time only) -docker compose run --rm nanobot-cli onboard - -# 2. Edit config to add API keys -vim ~/.nanobot/config.json - -# 3. Start gateway service -docker compose up -d nanobot-gateway - -# 4. Check logs -docker compose logs -f nanobot-gateway - -# 5. Run CLI commands -docker compose run --rm nanobot-cli status -docker compose run --rm nanobot-cli agent -m "Hello!" - -# 6. Stop services -docker compose down +docker compose run --rm nanobot-cli onboard # first-time setup +vim ~/.nanobot/config.json # add API keys +docker compose up -d nanobot-gateway # start gateway ``` -**Features:** -- ✅ Resource limits (1 CPU, 1GB memory) -- ✅ Auto-restart on failure -- ✅ Shared configuration using YAML anchors -- ✅ Separate CLI profile for on-demand commands +```bash +docker compose run --rm nanobot-cli agent -m "Hello!" # run CLI +docker compose logs -f nanobot-gateway # view logs +docker compose down # stop +``` -### Using Docker directly - -Build and run nanobot in a container: +### Docker ```bash # Build the image diff --git a/docker-compose.yml b/docker-compose.yml index 446f5e3..5c27f81 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,7 +23,6 @@ services: memory: 256M nanobot-cli: - container_name: nanobot-cli <<: *common-config profiles: - cli