← Back to all products
$29
Docker Compose Templates
50+ production Docker Compose configurations for common stacks: LAMP, MEAN, Django, Rails, microservices.
ShellJSONMarkdownYAMLConfigDockerRedisPostgreSQLNginxGrafana
📁 File Structure 12 files
docker-compose-templates/
├── LICENSE
├── README.md
├── guides/
│ └── docker-compose-patterns.md
├── scripts/
│ └── stack-manager.sh
├── shared/
│ ├── .env.example
│ └── traefik/
│ └── docker-compose.yml
└── stacks/
├── ci-runner/
│ └── docker-compose.yml
├── database/
│ └── docker-compose.yml
├── elk/
│ └── docker-compose.yml
├── monitoring/
│ └── docker-compose.yml
├── web-app/
│ └── docker-compose.yml
└── wordpress/
└── docker-compose.yml
📖 Documentation Preview README excerpt
Docker Compose Templates
Production-ready Docker Compose stacks for web apps, monitoring, logging, databases, and CI runners.
Drop-in Compose files for the most common self-hosted infrastructure. Each stack is tested, commented, and ready to deploy with a single docker compose up -d. Includes a Traefik reverse proxy with automatic TLS and a stack manager script.
---
What You Get
- 7 ready-to-deploy stacks — Web app, monitoring, ELK, CI runner, database, WordPress, Traefik
- Shared reverse proxy — Traefik with automatic Let's Encrypt certificates
- Stack manager script — Deploy, stop, restart, and check status of any stack
- Environment template — Documented
.env.examplewith all configurable variables - Patterns guide — Networking, volumes, health checks, secrets, and multi-service patterns
File Tree
docker-compose-templates/
├── README.md
├── manifest.json
├── LICENSE
├── stacks/
│ ├── web-app/docker-compose.yml # Nginx + Node.js + PostgreSQL + Redis
│ ├── monitoring/docker-compose.yml # Prometheus + Grafana + AlertManager
│ ├── elk/docker-compose.yml # Elasticsearch + Logstash + Kibana
│ ├── ci-runner/docker-compose.yml # GitLab Runner with Docker executor
│ ├── database/docker-compose.yml # PostgreSQL + pgAdmin + pgBouncer
│ └── wordpress/docker-compose.yml # WordPress + MariaDB + Redis + Nginx
├── shared/
│ ├── traefik/docker-compose.yml # Traefik v3 reverse proxy + Let's Encrypt
│ └── .env.example # Template environment variables
├── scripts/
│ └── stack-manager.sh # Deploy/stop/restart any stack
└── guides/
└── docker-compose-patterns.md # Networking, volumes, health checks
Getting Started
1. Configure Environment
cp shared/.env.example .env
# Edit .env with your domain, email, passwords, etc.
2. Start the Reverse Proxy
docker compose -f shared/traefik/docker-compose.yml up -d
3. Deploy a Stack
# Using the stack manager
./scripts/stack-manager.sh deploy web-app
*... continues with setup instructions, usage examples, and more.*
📄 Code Sample .yml preview
shared/traefik/docker-compose.yml
# Traefik Reverse Proxy — Automatic TLS with Let's Encrypt
# Routes traffic to all stacks via Docker labels, with HTTPS by default
#
# Usage: docker compose -f shared/traefik/docker-compose.yml up -d
# Dashboard: http://localhost:8080 (disable in production)
#
# Other stacks connect via Traefik labels — see web-app or monitoring stacks
services:
traefik:
image: traefik:v3.1
container_name: traefik
restart: unless-stopped
command:
# API / Dashboard
- "--api.dashboard=${TRAEFIK_DASHBOARD:-true}"
- "--api.insecure=${TRAEFIK_DASHBOARD:-true}" # Dashboard on :8080 without auth
# Docker provider — auto-discover services via labels
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false" # Only route services with traefik.enable=true
- "--providers.docker.network=traefik-public"
# Entrypoints
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
# HTTP → HTTPS redirect
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
# Let's Encrypt — automatic TLS certificates
- "--certificatesresolvers.letsencrypt.acme.email=${ACME_EMAIL:?Set ACME_EMAIL in .env}"
- "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
- "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web"
# Use staging server for testing to avoid rate limits:
# - "--certificatesresolvers.letsencrypt.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
# Access logs
- "--accesslog=true"
- "--accesslog.bufferingsize=100"
# Metrics
- "--metrics.prometheus=true"
- "--metrics.prometheus.entrypoint=metrics"
- "--entrypoints.metrics.address=:8082"
# Logging
- "--log.level=${TRAEFIK_LOG_LEVEL:-WARN}"
ports:
- "80:80"
- "443:443"
- "${TRAEFIK_DASHBOARD_PORT:-8080}:8080" # Dashboard (disable in production)
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- letsencrypt-data:/letsencrypt
networks:
# ... 26 more lines ...