# Use lightweight Python image FROM python:3.10-slim # Set working directory WORKDIR /code # Install dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy your app and db.json COPY app.py . COPY db.json . # Make db.json writable RUN chmod 666 db.json # Expose the port Hugging Face expects EXPOSE 7860 # Run the FastAPI app with uvicorn # --host 0.0.0.0 makes it accessible # --port 7860 is required for Spaces CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]