Skip to Content

Docker Deployment

Complete Docker examples for development and production deployments.

Quick Start

Basic Docker Run

docker run -d \
  --name inferno \
  -p 8080:8080 \
  ringo380/inferno:latest \
  serve --host 0.0.0.0 --port 8080

With Volume Mounts

docker run -d \
  --name inferno \
  -p 8080:8080 \
  -v ~/inferno-models:/data/models \
  -v ~/inferno-cache:/data/cache \
  ringo380/inferno:latest \
  serve --host 0.0.0.0 --port 8080

Docker Compose

Development Setup

version: '3.8'
 
services:
  inferno:
    image: ringo380/inferno:latest
    container_name: inferno-dev
    ports:
      - "8080:8080"
    volumes:
      - ./models:/data/models
      - ./cache:/data/cache
    command: serve --host 0.0.0.0 --port 8080
    restart: unless-stopped

Production Setup

version: '3.8'
 
services:
  inferno:
    image: ringo380/inferno:latest
    container_name: inferno-prod
    ports:
      - "8080:8080"
    volumes:
      - ./models:/data/models
      - ./cache:/data/cache
      - ./logs:/var/log/inferno
      - ./config.toml:/etc/inferno/config.toml:ro
    environment:
      - INFERNO_LOG_LEVEL=info
    command: serve --config /etc/inferno/config.toml
    restart: always
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
      interval: 30s
      timeout: 10s
      retries: 3
    deploy:
      resources:
        limits:
          cpus: '8'
          memory: 32G

GPU Support

NVIDIA GPU

docker run -d \
  --name inferno \
  --gpus all \
  -p 8080:8080 \
  -v ~/inferno-models:/data/models \
  ringo380/inferno:latest \
  serve --host 0.0.0.0 --port 8080

Docker Compose with GPU

version: '3.8'
 
services:
  inferno:
    image: ringo380/inferno:latest
    container_name: inferno-gpu
    ports:
      - "8080:8080"
    volumes:
      - ./models:/data/models
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]
    command: serve --host 0.0.0.0 --port 8080

Multi-Container Application

version: '3.8'
 
services:
  inferno:
    image: ringo380/inferno:latest
    container_name: inferno
    expose:
      - "8080"
    volumes:
      - models:/data/models
      - cache:/data/cache
    command: serve --host 0.0.0.0 --port 8080
 
  nginx:
    image: nginx:alpine
    container_name: nginx
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    depends_on:
      - inferno
 
  prometheus:
    image: prom/prometheus:latest
    container_name: prometheus
    ports:
      - "9090:9090"
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
      - prometheus-data:/prometheus
    depends_on:
      - inferno
 
volumes:
  models:
  cache:
  prometheus-data:

Building Custom Image

Dockerfile

FROM ringo380/inferno:latest
 
# Copy custom models
COPY ./models /data/models/
 
# Copy configuration
COPY ./config.toml /etc/inferno/config.toml
 
# Expose port
EXPOSE 8080
 
# Start server
CMD ["serve", "--config", "/etc/inferno/config.toml"]

Build and Run

# Build image
docker build -t my-inferno:latest .
 
# Run container
docker run -d -p 8080:8080 my-inferno:latest

Next Steps