services: app: build: context: . dockerfile: Dockerfile container_name: urlShortenerServer image: urlshortenerserver restart: unless-stopped env_file: - .env ports: - "3000:3000" volumes: - ./logs:/app/logs networks: - app-network healthcheck: test: [ "CMD", "node", "-e", "require('http').get('http://localhost:3000/api/health', res => process.exit(res.statusCode === 200 ? 0 : 1))" ] interval: 14m # 14 minutes timeout: 10s # Health check must respond within 10 seconds retries: 3 # Retry up to 3 times before marking as unhealthy start_period: 40s # Wait 40s after container starts before first check networks: app-network: driver: bridge volumes: logs: driver: local