test / Dockerfile
turome-learning's picture
Update Dockerfile
48b12c9 verified
FROM python:3.10
# 1. Create a writable cache directory for huggingface_hub
RUN mkdir -p /tmp/huggingface_cache
ENV HUGGINGFACE_HUB_CACHE=/tmp/huggingface_cache
# 2. Create a writable cache directory for Numba (used by rembg/pymatting)
RUN mkdir -p /tmp/numba_cache
ENV NUMBA_CACHE_DIR=/tmp/numba_cache
ENV NUMBA_DISABLE_JIT=1
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . /app/
# 3. Expose port 7860 for Hugging Face
EXPOSE 7860
# 4. Run your main.py (which calls uvicorn.run inside the __main__ block)
CMD ["python", "main.py"]