Skip to content

Deployment

Learn how to deploy Pillow to production environments with Docker, Kubernetes, and cloud platforms.

Pillow supports multiple deployment strategies:

  • Docker Compose for simple deployments
  • Kubernetes for scalable production deployments
  • Cloud platforms (AWS, GCP, Azure)
  • Traditional server deployments
docker-compose.prod.yml
version: "3.8"
services:
mill:
image: pillow/mill:latest
environment:
- NODE_ENV=production
- DATABASE_URL=${DATABASE_URL}
ports:
- "4000:4000"
depends_on:
- postgres
- redis
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
redpanda:
image: docker.redpanda.com/redpandadata/redpanda:latest
ports:
- "19092:19092"
volumes:
- redpanda_data:/var/lib/redpanda/data
volumes:
redis_data:
redpanda_data:
# Note: Database (Apache Doris) is hosted remotely at db.voltdata.io
# Configure connection in mill/config/.env
Terminal window
# Set environment variables
export DATABASE_HOST=db.voltdata.io
export DATABASE_PORT=9030
export DATABASE_USER=your_user
export DATABASE_PASSWORD=secure_password
export DATABASE_NAME=mill
# Deploy
docker-compose -f docker-compose.prod.yml up -d

Note: Database is hosted remotely. Configure connection in mill/config/.env or via environment variables.

k8s/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: pillow-mill
spec:
replicas: 3
selector:
matchLabels:
app: pillow-mill
template:
metadata:
labels:
app: pillow-mill
spec:
containers:
- name: mill
image: pillow/mill:latest
ports:
- containerPort: 4000
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: pillow-secrets
key: database-url
---
apiVersion: v1
kind: Service
metadata:
name: pillow-mill-service
spec:
selector:
app: pillow-mill
ports:
- protocol: TCP
port: 80
targetPort: 4000
type: LoadBalancer

Deploy using AWS ECS or EKS:

Terminal window
# Using AWS CLI and ECS
aws ecs create-cluster --cluster-name pillow
aws ecs create-service --cluster pillow --service-name pillow-mill

Deploy using Cloud Run or GKE:

Terminal window
# Using gcloud CLI
gcloud run deploy pillow-mill --image gcr.io/PROJECT_ID/pillow-mill

Deploy using Container Instances or AKS:

Terminal window
# Using Azure CLI
az container create --resource-group pillow-rg --name pillow-mill --image pillow/mill:latest
mill/config/.env.production
NODE_ENV=production
DATABASE_HOST=db.voltdata.io
DATABASE_PORT=9030
DATABASE_USER=your_user
DATABASE_PASSWORD=your_secure_password
DATABASE_NAME=mill
REDIS_URL=redis://host:6379
JWT_SECRET=your-super-secure-secret
API_PORT=4000
LOG_LEVEL=info
ENABLE_METRICS=true
  • Use secrets management (AWS Secrets Manager, K8s Secrets)
  • Enable HTTPS with SSL certificates
  • Configure proper firewall rules
  • Set up monitoring and alerting
  • Regular security updates
Terminal window
# Container health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:4000/health || exit 1
  • Prometheus: Metrics collection
  • Grafana: Visualization and dashboards
  • Jaeger: Distributed tracing
  • ELK Stack: Log aggregation and analysis
  • Load balancer configuration
  • Auto-scaling policies
  • Database read replicas
  • CDN for static assets
  • Database connection pooling
  • Redis caching strategies
  • Image optimization
  • CDN configuration
Terminal window
# Apache Doris backup (MySQL-compatible)
mysqldump -h db.voltdata.io -P 9030 -u your_user -p mill > backup_$(date +%Y%m%d_%H%M%S).sql
# Or use Doris-specific backup tools if available
  • Multi-region deployments
  • Data replication strategies
  • Recovery time objectives (RTO)
  • Recovery point objectives (RPO)