| # Use slim Python 3.11 image for minimal footprint | |
| FROM python:3.11-slim | |
| # Prevent Python buffering & set UTF-8 | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONIOENCODING=utf-8 | |
| # Install system deps (optional: for psutil) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| procps \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create app dir | |
| WORKDIR /app | |
| # Install Python deps | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # Copy source | |
| COPY phoenix_fury.py . | |
| # Expose API port | |
| EXPOSE 8000 | |
| # Run as non-root (optional but recommended) | |
| RUN useradd --create-home --shell /bin/bash appuser | |
| USER appuser | |
| # Launch with uvloop + optimized Uvicorn | |
| CMD ["python", "phoenix_fury.py"] |