Skip to content

Docker Deployment

Deploy YOLO-Toys using Docker containers.


📋 Prerequisites

  • Docker 20.10+
  • Docker Compose 2.0+ (optional)
  • 4GB+ available RAM
  • 2GB+ free disk space

🚀 Quick Start

Using Docker Run

bash
# Clone repository
git clone https://github.com/LessUp/yolo-toys.git
cd yolo-toys

# Copy environment configuration
cp .env.example .env

# Build and run
docker build -t yolo-toys .
docker run -d -p 8000:8000 --env-file .env yolo-toys
bash
docker-compose up -d

⚙️ docker-compose.yml Reference

yaml
services:
  yolo-toys:
    build: .
    ports:
      - "8000:8000"
    environment:
      - MODEL_NAME=yolov8n.pt
      - DEVICE=cpu
    volumes:
      - model-cache:/root/.cache
    restart: unless-stopped

volumes:
  model-cache:

🖥️ GPU Support

NVIDIA GPU

yaml
services:
  yolo-toys:
    runtime: nvidia
    environment:
      - NVIDIA_VISIBLE_DEVICES=all
      - DEVICE=cuda:0

🔧 Production Deployment

Reverse Proxy (Nginx)

nginx
server {
    listen 80;
    server_name yourdomain.com;

    location / {
        proxy_pass http://localhost:8000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
    }
}

Released under the MIT License.