Hardened Docker Setup
Run iii with security constraints:--read-only- Read-only root filesystem--tmpfs /tmp- Writable temporary directory--cap-drop=ALL- Drop all Linux capabilities--cap-add=NET_BIND_SERVICE- Allow binding to ports < 1024--security-opt=no-new-privileges:true- Prevent privilege escalation
Docker Compose Production
Usedocker-compose.prod.yml for production with Caddy reverse proxy:
docker-compose.prod.yml
Reverse Proxy (Caddy)
Caddy provides automatic HTTPS with Let’s Encrypt:Caddyfile
- Automatic HTTPS with Let’s Encrypt
- HTTP/2 and HTTP/3 support
- Automatic certificate renewal
- WebSocket proxying
your-domain.com with your actual domain. Caddy will automatically obtain SSL certificates.
Port Configuration
iii exposes four ports:
Recommended network setup:
- Expose port
49134directly for SDK connections (or via WSS proxy) - Proxy ports
3111and3112through Caddy/nginx with HTTPS - Keep port
9464internal (metrics scraping only)
Redis Setup
iii requires Redis for Queue and Stream modules.Redis Standalone
Redis Cluster
For high availability, use Redis Cluster or Redis Sentinel:config.prod.yaml
Production Configuration
Example production config with security best practices:config.prod.yaml
host: 0.0.0.0- Bind all interfaces (behind reverse proxy)- Specific CORS origins (not
*) - OTLP exporter for traces and logs
- Reduced sampling ratio (10%)
- File-based storage with persistent volumes
- Console logging disabled for logs
Environment Variables
Set production environment variables:.env
Monitoring
Prometheus Metrics
iii exposes Prometheus metrics on port9464:
prometheus.yml
iii_invocations_total- Total function invocationsiii_invocations_error- Failed invocationsiii_workers_active- Active worker connectionsiii_http_requests_total- HTTP requests- Custom metrics via OpenTelemetry
Health Checks
iii provides health check endpoints: HTTP health check:OpenTelemetry
Export traces and logs to OpenTelemetry Collector:otel-collector-config.yaml
Scaling
Horizontal Scaling
iii is stateless and can be scaled horizontally:- Shared Redis instance for Queue and Stream modules
- Load balancer for HTTP traffic (Caddy, nginx, HAProxy)
- Session affinity not required
Load Balancing
Use Caddy with multiple upstream servers:Backup and Recovery
Redis Backup
Enable Redis persistence:State Storage Backup
Backup file-based state:Security Checklist
1
Run as non-root user
Use distroless image or create non-root user in Dockerfile
2
Read-only filesystem
Run with
--read-only and mount writable volumes only where needed3
Drop capabilities
Use
--cap-drop=ALL --cap-add=NET_BIND_SERVICE4
Network isolation
Use Docker networks, don’t expose internal ports
5
HTTPS/TLS everywhere
Use Caddy or nginx for automatic HTTPS
6
Restrict CORS origins
Set specific allowed origins in production config
7
Environment secrets
Use Docker secrets or external secret managers
8
Update regularly
Keep iii and dependencies updated
Troubleshooting
Connection Issues
Workers can’t connect to WebSocket (port 49134):Redis Connection
iii can’t connect to Redis:High Memory Usage
Reduce memory consumption:Logs
View iii logs:Next Steps
Monitoring
Set up observability and alerting
Security
Advanced security hardening