Infra & Cloud
yaml
Intermediate
Docker Compose for Local Dev Stack
Full local dev stack: app, Postgres, Redis, and MailHog in one Compose file.
yaml
services:
app:
build: .
ports: ["8000:8000"]
environment:
DATABASE_URL: postgres://dev:dev@db:5432/dev
REDIS_URL: redis://cache:6379/0
depends_on: [db, cache]
db:
image: postgres:16-alpine
environment: { POSTGRES_USER: dev, POSTGRES_PASSWORD: dev, POSTGRES_DB: dev }
volumes: [pgdata:/var/lib/postgresql/data]
cache:
image: redis:7-alpine
mail:
image: mailhog/mailhog
ports: ["8025:8025"]
volumes:
pgdata:
Prerequisites
- Docker Compose v2+
Pro Tips
- → Add a .env file and reference with env_file: .env.
Commercial Licensing
Acquire a production access token or template license for enterprise deployment.
Module Info
- Language
- yaml
- Level
- Intermediate
- Read time
- 3 min
- Published
- Dec 2025
- License
- Commercial License
Newsletter
New modules every week, directly to your inbox.
Similar Modules
AWS S3 Static Website
Terraform module to provision an S3 bucket for static website hosting.
terraform
·
Intermediate
AWS RDS Postgres Terraform
Terraform resource for an RDS PostgreSQL instance with encryption and backup.
terraform
·
Intermediate
ECS Task Force Stop
Force-stop all running ECS tasks in a service for emergency rollback.
bash
·
Intermediate