Spaces:
Configuration error
Configuration error
File size: 491 Bytes
8c3edd8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 1. Base image: lightweight Linux + Python
FROM python:3.10-slim
# 2. Set working directory inside container
WORKDIR /app
# 3. Copy dependency list first (Docker caching trick)
COPY requirements.txt .
# 4. Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# 5. Copy only necessary app files
COPY model/ model/
# 6. Expose the port FastAPI will run on
EXPOSE 7860
# 7. Start the FastAPI app
CMD ["uvicorn", "model.api:app", "--host", "0.0.0.0", "--port", "7860"]
|