services: postgres: image: postgres:15 ports: - "${DB_PORT:-5432}:5432" environment: POSTGRES_USER: username POSTGRES_PASSWORD: password POSTGRES_DB: workout_cool volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U username -d workout_cool"] interval: 5s timeout: 5s retries: 5 workout_cool: build: context: . dockerfile: Dockerfile ports: - "${APP_PORT:-3000}:3000" depends_on: postgres: condition: service_healthy env_file: .env volumes: pgdata: