Skip to main content

Docker

Deploy your VideoSDK AI Agent Worker using Docker containers.

Prerequisites

  • Docker installed
  • VideoSDK authentication token

Quick Setup

1. Create Dockerfile

FROM python:3.11-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
&& rm -rf /var/lib/apt/lists/*

# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY . .

# Expose debug port
EXPOSE 8081

# Run the worker
CMD ["python", "main.py"]

2. Build and Run

# Build the image
docker build -t my-agent-worker .

# Run the container
docker run -d \
--name my-agent-worker \
-p 8081:8081 \
-e VIDEOSDK_AUTH_TOKEN="your_auth_token" \
my-agent-worker

3. Docker Compose (Optional)

Create docker-compose.yml:

docker-compose.yml
version: "3.8"

services:
agent-worker:
build: .
ports:
- "8081:8081"
environment:
- VIDEOSDK_AUTH_TOKEN=${VIDEOSDK_AUTH_TOKEN}
restart: unless-stopped

Run with:

docker-compose up -d

Deploy Updates

# Stop container
docker stop my-agent-worker

# Remove old container
docker rm my-agent-worker

# Build new image
docker build -t my-agent-worker .

# Run new container
docker run -d \
--name my-agent-worker \
-p 8081:8081 \
-e VIDEOSDK_AUTH_TOKEN="your_auth_token" \
my-agent-worker

Monitor

# Check container status
docker ps

# View logs
docker logs my-agent-worker

# Execute commands in container
docker exec -it my-agent-worker bash

Scaling

To support more concurrent agents, you can run multiple containers using the same image. Each container will register with the VideoSDK backend registry and automatically receive job assignments.

Run multiple containers:

# Run additional containers
docker run -d \
--name my-agent-worker-2 \
-p 8082:8081 \
-e VIDEOSDK_AUTH_TOKEN="your_auth_token" \
my-agent-worker

docker run -d \
--name my-agent-worker-3 \
-p 8083:8081 \
-e VIDEOSDK_AUTH_TOKEN="your_auth_token" \
my-agent-worker

Or scale with Docker Compose:

docker-compose up -d --scale agent-worker=3

Got a Question? Ask us on discord