backend / Dockerfile
muhammadhasnain100's picture
Cursor
Pin bcrypt<4.1 for passlib compatibility; drop deprecated TRANSFORMERS_CACHE env
b340c14
Raw History Blame Contribute Delete
698 Bytes
# Hugging Face Docker Space: https://huggingface.co/docs/hub/spaces-sdks-docker
FROM python:3.10-bookworm
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
# Cache heavy HF downloads on writable paths inside the container
ENV HF_HOME=/tmp/hf_home
ENV SENTENCE_TRANSFORMERS_HOME=/tmp/hf_home/sentence_transformers
WORKDIR /app
COPY --chown=user ./requirements.txt ./requirements.txt
RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
&& pip install --no-cache-dir --upgrade -r requirements.txt
COPY --chown=user . /app
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]