Docker Deployment
Deploy Veriafy as a containerized service
Quick Start
# CPU only docker run -d -p 8080:8080 veriafy/veriafy:latest # With GPU support (NVIDIA) docker run -d --gpus all -p 8080:8080 veriafy/veriafy:latest-gpu # With persistent model storage docker run -d -p 8080:8080 \ -v veriafy-models:/app/models \ veriafy/veriafy:latest
Docker Compose
version: '3.8'
services:
veriafy:
image: veriafy/veriafy:latest
ports:
- "8080:8080"
volumes:
- veriafy-models:/app/models
- veriafy-data:/app/data
environment:
- VERIAFY_API_KEY=${VERIAFY_API_KEY}
- VERIAFY_LOG_LEVEL=info
- VERIAFY_WORKERS=4
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
volumes:
veriafy-models:
veriafy-data:GPU Support
version: '3.8'
services:
veriafy:
image: veriafy/veriafy:latest-gpu
ports:
- "8080:8080"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
environment:
- VERIAFY_GPU=1
- CUDA_VISIBLE_DEVICES=0
volumes:
- veriafy-models:/app/modelsEnvironment Variables
| Variable | Description | Default |
|---|---|---|
| VERIAFY_API_KEY | API key for cloud features | - |
| VERIAFY_PORT | HTTP server port | 8080 |
| VERIAFY_WORKERS | Number of worker processes | 4 |
| VERIAFY_GPU | Enable GPU (0 or 1) | 0 |
| VERIAFY_LOG_LEVEL | Log level | info |
| VERIAFY_MODEL_PATH | Model storage path | /app/models |
API Endpoints
The Docker container exposes a REST API on port 8080:
# Health check curl http://localhost:8080/health # Classify a file curl -X POST http://localhost:8080/api/v1/classify \ -F "file=@document.pdf" \ -F "model=veriafy/fraud-detection" # Extract vector only curl -X POST http://localhost:8080/api/v1/extract \ -F "file=@image.jpg" # List models curl http://localhost:8080/api/v1/models
Production Configuration
version: '3.8'
services:
veriafy:
image: veriafy/veriafy:latest-gpu
ports:
- "8080:8080"
deploy:
replicas: 3
resources:
limits:
memory: 8G
reservations:
memory: 4G
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
environment:
- VERIAFY_WORKERS=8
- VERIAFY_GPU=1
- VERIAFY_LOG_LEVEL=warn
volumes:
- veriafy-models:/app/models
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./certs:/etc/nginx/certs:ro
depends_on:
- veriafy