Simplify Docker Compose docs and remove fixed CLI container name
This commit is contained in:
parent
fae573573f
commit
aad1df5b9b
39
README.md
39
README.md
@ -811,40 +811,21 @@ nanobot cron remove <job_id>
|
|||||||
> [!TIP]
|
> [!TIP]
|
||||||
> The `-v ~/.nanobot:/root/.nanobot` flag mounts your local config directory into the container, so your config and workspace persist across container restarts.
|
> 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)
|
### Docker Compose
|
||||||
|
|
||||||
The easiest way to run nanobot with Docker:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 1. Initialize config (first time only)
|
docker compose run --rm nanobot-cli onboard # first-time setup
|
||||||
docker compose run --rm nanobot-cli onboard
|
vim ~/.nanobot/config.json # add API keys
|
||||||
|
docker compose up -d nanobot-gateway # start gateway
|
||||||
# 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:**
|
```bash
|
||||||
- ✅ Resource limits (1 CPU, 1GB memory)
|
docker compose run --rm nanobot-cli agent -m "Hello!" # run CLI
|
||||||
- ✅ Auto-restart on failure
|
docker compose logs -f nanobot-gateway # view logs
|
||||||
- ✅ Shared configuration using YAML anchors
|
docker compose down # stop
|
||||||
- ✅ Separate CLI profile for on-demand commands
|
```
|
||||||
|
|
||||||
### Using Docker directly
|
### Docker
|
||||||
|
|
||||||
Build and run nanobot in a container:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Build the image
|
# Build the image
|
||||||
|
|||||||
@ -23,7 +23,6 @@ services:
|
|||||||
memory: 256M
|
memory: 256M
|
||||||
|
|
||||||
nanobot-cli:
|
nanobot-cli:
|
||||||
container_name: nanobot-cli
|
|
||||||
<<: *common-config
|
<<: *common-config
|
||||||
profiles:
|
profiles:
|
||||||
- cli
|
- cli
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user