File size: 903 Bytes
935a93f b728bb3 935a93f b728bb3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04
# Install dependencies
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
git \
poppler-utils \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Create cache directories with proper permissions
RUN mkdir -p /app/.cache /app/.config /app/flagged && \
chmod 777 /app/.cache /app/.config /app/flagged
# Set environment variables for cache directories
ENV TRANSFORMERS_CACHE=/app/.cache/huggingface
ENV HF_HOME=/app/.cache/huggingface
ENV HUGGINGFACE_HUB_CACHE=/app/.cache/huggingface
ENV MPLCONFIGDIR=/app/.config/matplotlib
ENV HF_HUB_DISABLE_SYMLINKS_WARNING=1
ENV PYTHONUNBUFFERED=1
# Copy the requirements file and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the app code
COPY app.py .
# Run the app
CMD ["python3", "app.py"]
|