version: '3.8' services: db: image: postgres:16-alpine container_name: wishlist-db environment: POSTGRES_USER: wishlistuser POSTGRES_PASSWORD: wishlistpassword POSTGRES_DB: wishlist ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U wishlistuser -d wishlist"] interval: 10s timeout: 5s retries: 5 app: build: context: . dockerfile: Dockerfile container_name: wishlist-app environment: DATABASE_URL: postgresql://wishlistuser:wishlistpassword@db:5432/wishlist NODE_ENV: production PORT: 3000 ports: - "3000:3000" depends_on: db: condition: service_healthy restart: unless-stopped volumes: postgres_data: