version: "3" services: web: build: . ports: - "3000:3000" restart: always environment: DATABASE_URL: postgresql://next:next@db:5432/next depends_on: db: condition: service_healthy healthcheck: test: ["CMD-SHELL", "curl http://localhost:3000/api/heartbeat"] interval: 5s timeout: 5s retries: 5 db: image: postgres:15-alpine environment: POSTGRES_DB: next POSTGRES_USER: next POSTGRES_PASSWORD: next volumes: - next-db-data:/var/lib/postgresql/data restart: always healthcheck: test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] interval: 5s timeout: 5s retries: 5 volumes: next-db-data: