FROM python:3.9 WORKDIR /code # Copy your requirements first for better caching COPY ./requirements.txt /code/requirements.txt # Install dependencies RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt # Copy all your files (app.py, index.html) into the container COPY . . # Start the FastAPI app using Uvicorn on port 7860 (Required by HF Spaces) CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]