Spaces:
Running
Running
File size: 523 Bytes
df362bc 510de5b 9d6cb48 510de5b ad0b123 df362bc 510de5b df362bc 963cf7b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
FROM python:3.10-slim
WORKDIR /app
# 1️⃣ Create a writable cache and point HF libs at it
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
ENV HF_HOME=/app/.cache
ENV XDG_CACHE_HOME=/app/.cache
# 2️⃣ Install git, Python deps
RUN apt-get update && \
apt-get install -y git && \
rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 3️⃣ Copy your FastAPI code
COPY . .
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|