Docker Installation

Run Savfox in a containerized environment.

Pull the Image

docker pull ghcr.io/savfox-ai/savfox:latest

Available tags:

  • latest - Latest stable release
  • main - Latest main branch build
  • v0.3.0 - Specific version tags

Basic Usage

Interactive session:

docker run -it --rm ghcr.io/savfox-ai/savfox:latest

Non-interactive execution:

docker run --rm ghcr.io/savfox-ai/savfox:latest exec "Explain this code"

Volume Mounting

Mount your workspace and config:

docker run -it --rm \
  -v ~/.savfox:/root/.savfox \
  -v $(pwd):/workspace \
  -w /workspace \
  ghcr.io/savfox-ai/savfox:latest

Gateway Mode

Run the gateway server:

docker run -d \
  --name savfox-gateway \
  -p 18881:18881 \
  -v ~/.savfox:/root/.savfox \
  -v $(pwd):/workspace \
  ghcr.io/savfox-ai/savfox:latest \
  savfox gateway --host 0.0.0.0

Docker Compose

Complete setup with gateway:

services:
  savfox:
    image: ghcr.io/savfox-ai/savfox:latest
    container_name: savfox
    restart: unless-stopped
    volumes:
      - ./config:/root/.savfox
      - ./workspace:/workspace
    ports:
      - '18881:18881'
    working_dir: /workspace
    command: savfox gateway --host 0.0.0.0
    environment:
      - RUST_LOG=info

Start:

docker compose up -d
docker compose logs -f

Environment Variables

VariableDescription
RUST_LOGLog level (debug, info, warn, error)
SAVFOX_CONFIG_PATHOverride config file path
SAVFOX_HOMEOverride home directory

Building Custom Image

FROM rust:1.94 AS builder
WORKDIR /app
COPY . .
RUN cargo build --release -p savfox-cli

FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/savfox /usr/local/bin/
ENTRYPOINT ["savfox"]

Build:

docker build -t savfox-custom .