# Dockerfile # Use a lean official Python image FROM python:3.10-slim # Set working directory WORKDIR /app # Copy requirements and install dependencies COPY requirements.txt /app/ RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu RUN pip install --no-cache-dir -r requirements.txt # Copy the application code COPY main.py /app/ COPY tests/ /app/tests/ # The port is often fixed by the cloud host (e.g., 7860 for HF Spaces) # We use 8000 as a standard, and the cloud host will map its port to this one. EXPOSE 8000 # Command to run the application using Uvicorn CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]