vector-search-demo / Dockerfile
shima-n's picture
Update Dockerfile
df108e9 verified
raw
history blame contribute delete
704 Bytes
FROM python:3.10-slim
RUN apt-get update && apt-get install -y \
git git-lfs ffmpeg libsm6 libxext6 libgl1 && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# set writable caches
ENV HF_HOME=/app/.cache \
HF_HUB_CACHE=/app/.cache/hub \
HF_DATASETS_CACHE=/app/.cache/datasets \
TRANSFORMERS_CACHE=/app/.cache/transformers
RUN mkdir -p /app/.cache/hub /app/.cache/datasets /app/.cache/transformers
# copy code and data
COPY . .
# create non-root user and give it ownership
RUN useradd -m -u 1000 user && chown -R user:user /app
USER user
ENV GRADIO_SERVER_NAME=0.0.0.0
ENV PORT=7860
CMD ["python","app.py"]