Skip to content

Docker Deployment

Deploy Subtide backend using Docker.


Terminal window
cd backend
docker-compose up subtide-tier2

The backend will be available at http://localhost:5001.


YouTube captions only, no transcription:

Terminal window
docker-compose up subtide-tier1

Use when:

  • Videos have existing captions
  • You want minimal resource usage
  • Browser provides the API key

Full Whisper transcription support:

Terminal window
docker-compose up subtide-tier2

Use when:

  • You need transcription for any video
  • Browser provides the API key
  • Most common choice

Server-side API key:

Terminal window
SERVER_API_KEY=sk-xxx \
SERVER_API_URL=https://api.openai.com/v1 \
SERVER_MODEL=gpt-4o \
docker-compose up subtide-tier3

Use when:

  • Deploying for a team
  • Centralizing API key management
  • Hiding API key from clients

Real-time progressive translation:

Terminal window
SERVER_API_KEY=sk-xxx \
SERVER_API_URL=https://api.openai.com/v1 \
SERVER_MODEL=gpt-4o \
docker-compose up subtide-tier4

Use when:

  • You want subtitles as they’re generated
  • Lowest perceived latency
  • Server handles everything

Terminal window
cd backend
docker build -t subtide-backend .
Terminal window
# Standard backend
docker pull ghcr.io/rennerdo30/subtide-backend:latest
# RunPod variant
docker pull ghcr.io/rennerdo30/subtide-runpod:latest

Pass environment variables to configure the container:

Terminal window
docker run -d \
-p 5001:5001 \
-e WHISPER_MODEL=large-v3-turbo \
-e WHISPER_BACKEND=faster \
-e CORS_ORIGINS="*" \
ghcr.io/rennerdo30/subtide-backend:latest
VariableDescriptionDefault
PORTInternal port5001
GUNICORN_WORKERSWorker processes2
GUNICORN_TIMEOUTRequest timeout (s)300
CORS_ORIGINSCORS allowed origins*
WHISPER_MODELWhisper model sizebase
WHISPER_BACKENDmlx, faster, openaiAuto
SERVER_API_KEYAPI key (Tier 3/4)
SERVER_API_URLLLM endpoint (Tier 3/4)
SERVER_MODELLLM model (Tier 3/4)

Persist downloaded Whisper models:

Terminal window
docker run -d \
-p 5001:5001 \
-v ~/.cache/whisper:/root/.cache/whisper \
ghcr.io/rennerdo30/subtide-backend:latest

Mount a custom .env file:

Terminal window
docker run -d \
-p 5001:5001 \
-v /path/to/.env:/app/.env \
ghcr.io/rennerdo30/subtide-backend:latest

Use the NVIDIA Container Toolkit:

Terminal window
docker run -d \
--gpus all \
-p 5001:5001 \
-e WHISPER_BACKEND=faster \
ghcr.io/rennerdo30/subtide-backend:latest

Requires:


version: '3.8'
services:
subtide:
image: ghcr.io/rennerdo30/subtide-backend:latest
ports:
- "5001:5001"
environment:
- WHISPER_MODEL=large-v3-turbo
- WHISPER_BACKEND=faster
- CORS_ORIGINS=*
- GUNICORN_WORKERS=4
- GUNICORN_TIMEOUT=600
volumes:
- whisper-cache:/root/.cache/whisper
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
volumes:
whisper-cache:

Docker health check is built-in:

Terminal window
docker ps
# Check HEALTH column
docker inspect --format='{{.State.Health.Status}}' <container>

Manual check:

Terminal window
curl http://localhost:5001/health

Check logs:

Terminal window
docker logs <container_id>

Common causes:

  • Port already in use
  • Missing environment variables
  • Insufficient memory

Increase Docker memory limit or use a smaller model:

Terminal window
-e WHISPER_MODEL=base

On Linux, add your user to the docker group:

Terminal window
sudo usermod -aG docker $USER

  1. Use specific tags instead of latest
  2. Set resource limits for memory and CPU
  3. Configure logging with log drivers
  4. Use secrets for API keys instead of environment variables
  5. Set up health checks for orchestration