# Base image FROM python:3.10-slim # Set environment variables ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 # Set working directory WORKDIR /app # Install dependencies COPY requirements.txt /app/ RUN pip install --upgrade pip && pip install -r requirements.txt # Copy project files COPY . /app/ # Expose port (use Hugging Face $PORT or fallback to 7860) EXPOSE 7860 # Start server (use $PORT dynamically) CMD uvicorn api.app:app --host 0.0.0.0 --port ${PORT:-7860}