rightnight / Dockerfile
mac9087's picture
Update Dockerfile
d33be4e verified
raw
history blame contribute delete
974 Bytes
FROM python:3.10-slim
WORKDIR /app
ENV HF_HOME=/tmp/huggingface
ENV TRANSFORMERS_CACHE=/tmp/huggingface/transformers
ENV HF_DATASETS_CACHE=/tmp/huggingface/datasets
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV CUDA_VISIBLE_DEVICES=""
ENV HF_TOKEN=${HF_TOKEN}
RUN apt-get update && apt-get install -y \
build-essential \
libgl1-mesa-glx \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
cmake \
libopenblas-dev \
liblapack-dev \
libopencv-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /tmp/uploads /tmp/results /tmp/huggingface/transformers /tmp/huggingface/datasets \
&& chmod -R 777 /tmp/uploads /tmp/results /tmp/huggingface
# Copy requirements file and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -U pip && \
pip install --no-cache-dir -r requirements.txt && \
pip cache purge
COPY app.py .
EXPOSE 7860
CMD ["python", "app.py"]