About this tool
Web app + PostgreSQL with a named volume and healthcheck.
Ready-to-use docker-compose.yml — view the content, copy it, or download it with the correct filename. Free and 100% in your browser.
Web app + PostgreSQL with a named volume and healthcheck.
services:
web:
build: .
ports:
- "3000:3000"
environment:
DATABASE_URL: postgres://app:secret@db:5432/app
depends_on:
db:
condition: service_healthy
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: app
POSTGRES_PASSWORD: secret
POSTGRES_DB: app
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U app"]
interval: 5s
timeout: 3s
retries: 5
volumes:
pgdata:
Web app + PostgreSQL with a named volume and healthcheck.
Ready-to-use docker-compose.yml — view the content, copy it, or download it with the correct filename. Free and 100% in your browser.