A worked example, rendered from real sample data. Sign in to run the tool on your own input.
services=api,postgres,redis port=3000services:
api:
build: .
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/app
- REDIS_URL=redis://redis:6379
depends_on:
- postgres
- redis
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: app
volumes:
- pg_data:/var/lib/postgresql/data
ports:
- "5432:5432"
redis:
image: redis:7-alpine
restart: unless-stopped
ports:
- "6379:6379"
volumes:
pg_data:
mongo_data:

Wire up api + postgres + redis + mongo into a single compose file. Part of the DevTools Surf developer suite. Browse more tools in the Generators collection.