FROM python:3.11-slim ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 WORKDIR /app COPY requirements.txt ./ RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY . . # Hugging Face Spaces usually provides $PORT (commonly 7860). Expose 7860 and # default to 7860 at runtime using bash expansion when $PORT is not set. EXPOSE 7860 CMD ["bash", "-c", "uvicorn app:app --host 0.0.0.0 --port ${PORT:-7860}"]