FROM python:3.10-slim WORKDIR /app # Install dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application files COPY . . # Create a user to avoid running as root (Good practice for HF) RUN useradd -m -u 1000 user USER user ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH # Expose port (HF expects 7860 usually, but we can configure whatever) # Actually, HF Spaces map port 7860 by default for Gradio/Streamlit, # for Docker we must listen on 7860. EXPOSE 7860 # Command to run # We must launch uvicorn on 0.0.0.0:7860 CMD ["uvicorn", "chiral_api:app", "--host", "0.0.0.0", "--port", "7860"]