Docker Deployment¶
RAGents provides Docker images for easy deployment and scaling.
Quick Start¶
Run RAGents in a container:
Building from Source¶
Build the Docker image:
Docker Compose¶
Use Docker Compose for multi-service deployments:
version: '3.8'
services:
ragents:
image: ragents:latest
ports:
- "8000:8000"
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- RAGENTS_LLM_PROVIDER=openai
volumes:
- ./data:/app/data
depends_on:
- chromadb
- redis
chromadb:
image: chromadb/chroma:latest
ports:
- "8001:8000"
volumes:
- chromadb_data:/chroma/chroma
redis:
image: redis:alpine
ports:
- "6379:6379"
volumes:
chromadb_data:
Environment Variables¶
Configure your container with environment variables:
docker run \
-e OPENAI_API_KEY=your-key \
-e RAGENTS_LLM_PROVIDER=openai \
-e RAGENTS_CHUNK_SIZE=1000 \
-e RAGENTS_TOP_K=5 \
-p 8000:8000 \
ragents:latest
Production Considerations¶
Resource Limits¶
Set appropriate resource limits:
Health Checks¶
The container includes health checks:
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
Persistent Storage¶
Mount volumes for persistent data:
docker run \
-v $(pwd)/data:/app/data \
-v $(pwd)/logs:/app/logs \
-e OPENAI_API_KEY=your-key \
ragents:latest
Multi-Stage Builds¶
The Dockerfile uses multi-stage builds for optimization:
- Development: Full development environment
- Production: Minimal runtime environment
- GPU: CUDA support for vision models