Docker Deployment
Zooni ships with a multi-stage Dockerfile that produces a minimal runtime image.
Build
docker build -t zooni .
The build:
- Compiles all three binaries (
trading-bot,backtest,scan) in a Rust builder stage - Copies only the binaries into a slim Debian runtime image
- Final image includes just
ca-certificatesfor HTTPS
Run
# Basic run
docker run -v $(pwd)/config.toml:/data/config.toml zooni
# With Telegram
docker run \
-e TELEGRAM_BOT_TOKEN="123456:ABC..." \
-e TELEGRAM_CHAT_ID="987654321" \
-v $(pwd)/config.toml:/data/config.toml \
zooni
# Expose dashboard
docker run \
-p 9090:9090 \
-v $(pwd)/config.toml:/data/config.toml \
zooni
# Persistent database
docker run \
-v $(pwd)/config.toml:/data/config.toml \
-v $(pwd)/data:/data \
zooni
# Dry-run mode
docker run \
-v $(pwd)/config.toml:/data/config.toml \
zooni config.toml --dry-run
Docker Compose
services:
zooni:
build: .
restart: unless-stopped
ports:
- "9090:9090"
volumes:
- ./config.toml:/data/config.toml:ro
- zooni-data:/data
environment:
- RUST_LOG=info
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
- TELEGRAM_CHAT_ID=${TELEGRAM_CHAT_ID}
volumes:
zooni-data:
Scanner in Docker
docker run --rm \
-v $(pwd)/config.toml:/data/config.toml \
--entrypoint scan \
zooni --config config.toml --top 10
Notes
- Config is expected at
/data/config.toml - Database is created at
/data/trading-bot.db - Mount
/dataas a volume to persist the database across restarts - The image is based on
debian:bookworm-slim(~80MB)