Skip to content

Docker Deployment ​

Deploying OneASR with Docker is the recommended way for production environments, NAS devices, and cloud GPU instances.


1. Quick Start with docker run ​

GPU Accelerated (NVIDIA CUDA) ​

Ensure the NVIDIA Container Toolkit is installed on your host.

bash
docker run -d \
  --name oneasr-gateway \
  --gpus all \
  -p 8000:8000 \
  -v $(pwd)/models:/app/models \
  -v $(pwd)/config.yaml:/app/config.yaml \
  --restart unless-stopped \
  codeandxv/oneasr:latest

CPU Mode (No GPU required) ​

bash
docker run -d \
  --name oneasr-gateway \
  -p 8000:8000 \
  -v $(pwd)/models:/app/models \
  -v $(pwd)/config.yaml:/app/config.yaml \
  --restart unless-stopped \
  codeandxv/oneasr:latest

Create a docker-compose.yml in your working directory:

yaml
version: '3.8'

services:
  oneasr:
    image: codeandxv/oneasr:latest
    container_name: oneasr-gateway
    restart: unless-stopped
    ports:
      - "8000:8000"
    environment:
      - ONEASR_API_KEY=sk-oneasr-v1-p_L3kXm9QZ8sT2vA4wE7rY1u
      - WORKERS=2
    volumes:
      - ./models:/app/models
      - ./config.yaml:/app/config.yaml
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]

Start the service:

bash
docker compose up -d

Check the server logs:

bash
docker compose logs -f oneasr

3. Verify Health & OpenAPI Docs ​

Once running, visit:

  • Interactive Web Console: http://localhost:8000
  • Swagger OpenAPI Docs: http://localhost:8000/docs
  • Health Check Endpoint: http://localhost:8000/api/v1/health