Docker Compose for Production: You Don't Always Need Kubernetes
Not every project needs Kubernetes. For single-server deployments, Docker Compose with proper health checks, restart policies, resource limits, and a deploy strategy gives you 90% of the reliability at 10% of the complexity. We build production Compose stacks that run reliably without an orchestration layer.
Need this done for your project?
We implement, you ship. Async, documented, done in days.
When Compose Beats Kubernetes
Kubernetes is the right choice for multi-region, multi-team, dynamically scaling workloads. It is the wrong choice for a 3-service SaaS running on a single $50/month VPS. The operational overhead of maintaining a K8s cluster — etcd backups, control plane upgrades, RBAC policies, ingress controllers — is not justified for most early-stage products.
Docker Compose with proper configuration handles restart on failure, health-based dependency ordering, resource constraints, log rotation, and rolling updates. It deploys in seconds, not minutes, and the entire stack definition fits in one readable YAML file.
Our Production Compose Configuration
Every production Compose file we deliver includes:
- Health checks: Every service gets a
healthcheckwithtest,interval,timeout,retries, andstart_period. Dependent services usedepends_on: { db: { condition: service_healthy } }. - Restart policies:
restart: unless-stoppedfor app services,restart: alwaysfor infrastructure (DB, Redis). - Resource limits:
deploy.resources.limitswithcpusandmemoryto prevent any single service from starving others. - Logging:
logging: driver: json-filewithmax-size: 10mandmax-file: 3to prevent disk exhaustion. - Networks: Separate
frontendandbackendnetworks so the database is not accessible from the web-facing service's network.
Zero-Downtime Deploy Strategy
We implement zero-downtime deploys with Compose using a blue-green pattern:
- Pull the new image:
docker compose pull - Scale up new containers:
docker compose up -d --no-deps --scale app=2 app - Wait for health check to pass on the new container
- Scale down to 1:
docker compose up -d --no-deps --scale app=1 app
Alternatively, we use a simple deploy script with Nginx upstream reloads. The script builds the new image, starts a new container on a different port, verifies the health check, switches the Nginx upstream, and removes the old container. Total downtime: zero.
What You Get
- Production
docker-compose.ymlwith health checks, restart policies, and resource limits - Network isolation between frontend and backend services
- Log rotation configuration preventing disk exhaustion
- Zero-downtime deploy script (bash or Makefile)
- Systemd unit file to start Compose on boot
- Monitoring integration with Prometheus and Grafana (optional)
Why Anubiz Engineering
Ready to get started?
Skip the research. Tell us what you need, and we'll scope it, implement it, and hand it back — fully documented and production-ready.