services: payload: build: context: . dockerfile: Dockerfile image: hanoman-website-be:latest restart: unless-stopped ports: - '3000:3000' depends_on: postgres: condition: service_healthy env_file: - .env environment: NODE_ENV: production DATABASE_URL: ${DATABASE_URL} # Ensure DATABASE_URL points to this service when running in Docker: # postgresql://postgres:postgres@postgres:5432/hanoman postgres: restart: unless-stopped image: postgres:16 environment: POSTGRES_DB: ${POSTGRES_DB} POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} volumes: - pgdata:/var/lib/postgresql/data ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] interval: 10s timeout: 5s retries: 5 volumes: pgdata: