← Back to all products

Docker Compose Templates

$19

Production-ready Docker Compose configurations for the most common web stacks.

📁 14 files
MarkdownYAMLConfigDockerDjangoFlaskRedisPostgreSQLMongoDBNginx

📄 Product Preview

Try the interactive reader and demo tools below, or get the full product with all content unlocked.

📖 Interactive Reader (Free Preview) ⚙ Try Demo Tools 📦 Download Free Sample

📁 File Structure 14 files

docker-compose-templates/ ├── LICENSE ├── README.md ├── examples/ │ └── env.example ├── free-sample.zip ├── guide/ │ ├── 01_features.md │ ├── 02_quick-start.md │ ├── 03_configuration.md │ └── 04_faq.md ├── index.html └── src/ ├── docker-compose-django.yml ├── docker-compose-flask.yml ├── docker-compose-lamp.yml ├── docker-compose-mean.yml └── docker-compose-rails.yml

📖 Documentation Preview README excerpt

Docker Compose Templates

Production-ready Docker Compose configurations for the most common web stacks. Copy, customize, and docker-compose up.

Features

  • LAMP stack — Apache, MySQL 8, PHP 8.2 with phpMyAdmin
  • MEAN stack — MongoDB, Express, Angular (served via Nginx), Node.js
  • Django stack — Python 3.12, Django, PostgreSQL, Redis, Nginx
  • Flask stack — Python 3.12, Flask, PostgreSQL, Redis, Celery
  • Rails stack — Ruby 3.3, Rails 7, PostgreSQL, Redis, Sidekiq
  • Health checks on all services for reliable startup ordering
  • Named volumes for persistent data across restarts
  • Environment files for secrets and configuration
  • Production-ready defaults with sensible resource limits

Requirements

  • Docker 24+ and Docker Compose V2
  • No Python or other runtime dependencies

Quick Start


# Pick a stack and start it
cd src/
docker compose -f docker-compose-django.yml up -d

# Check running services
docker compose -f docker-compose-django.yml ps

# View logs
docker compose -f docker-compose-django.yml logs -f

# Tear down
docker compose -f docker-compose-django.yml down -v

Included Stacks

FileStackServicesPorts
docker-compose-lamp.ymlLAMPApache, PHP 8.2, MySQL 8, phpMyAdmin80, 8080
docker-compose-mean.ymlMEANNode.js, MongoDB, Nginx80, 3000
docker-compose-django.ymlDjangoPython, Django, PostgreSQL, Redis, Nginx80, 8000
docker-compose-flask.ymlFlaskPython, Flask, PostgreSQL, Redis, Celery80, 5000
docker-compose-rails.ymlRailsRuby, Rails, PostgreSQL, Redis, Sidekiq80, 3000

Configuration

Each stack uses an .env file for configuration. See examples/ for sample env files.

VariableDefaultDescription
DB_NAMEapp_dbDatabase name
DB_USERapp_userDatabase user
DB_PASSWORDchangeme_in_productionDatabase password
DB_PORTvariesDatabase port
REDIS_URLredis://redis:6379/0Redis connection URL
APP_ENVdevelopmentApplication environment

... continues with setup instructions, usage examples, and more.

📄 Code Sample .yml preview

src/docker-compose-django.yml # ============================================================ # Docker Compose — Django Stack # Deploy Kit (CodeVault) # # Full Django development and production stack: # - Python 3.12 + Django via Gunicorn # - PostgreSQL 16 for the database # - Redis for caching and Celery broker # - Nginx as reverse proxy # - Celery worker for async tasks # # Usage: # cp ../examples/env.django .env # docker compose -f docker-compose-django.yml up -d # # IMPORTANT: Change ALL default passwords before deploying # to any environment beyond localhost. # ============================================================ services: # ----------------------------------------------------------- # PostgreSQL 16 — Primary database # Why Postgres: Battle-tested, great Django support, rich # ecosystem of extensions (PostGIS, pg_trgm, etc.) # ----------------------------------------------------------- db: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_DB: ${DB_NAME:-app_db} POSTGRES_USER: ${DB_USER:-app_user} # SECURITY: Change this password before deploying anywhere POSTGRES_PASSWORD: ${DB_PASSWORD:-changeme_in_production} volumes: # Named volume ensures data survives container restarts - postgres_data:/var/lib/postgresql/data ports: # Expose to host for local dev tools (pgAdmin, DBeaver) # Remove this port mapping in production - "${DB_PORT:-5432}:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-app_user} -d ${DB_NAME:-app_db}"] interval: 10s timeout: 5s retries: 5 # Resource limits prevent runaway queries from killing the host deploy: resources: limits: memory: 512M # ... 154 more lines ...
Buy Now — $19 Back to Products