version: "3.9" services: postgres: image: postgres:17 healthcheck: test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USER}"] interval: 10s timeout: 5s retries: 5 container_name: postgres restart: unless-stopped env_file: - .env.production environment: POSTGRES_USER: ${DATABASE_USER} POSTGRES_PASSWORD: ${DATABASE_PASS} POSTGRES_DB: ${DATABASE_NAME} volumes: - postgres_data:/var/lib/postgresql/data redis: image: redis:8-alpine restart: unless-stopped app: build: . container_name: nest-app restart: unless-stopped depends_on: postgres: condition: service_healthy environment: NODE_ENV: production env_file: - .env.production ports: - "8000:8000" volumes: postgres_data: