Spaces:
Runtime error
Runtime error
File size: 916 Bytes
da59cbe 27b79c7 d11d533 27b79c7 da59cbe 27b79c7 da59cbe 27b79c7 da59cbe d11d533 27b79c7 d11d533 da59cbe d11d533 27b79c7 da59cbe d11d533 27b79c7 da59cbe 896e60d |
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 |
FROM ubuntu:22.04
# Install necessary packages
RUN apt-get update && apt-get install -y curl git python3 python3-pip && \
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get install -y git-lfs
# Install Python dependencies
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Create a non-root user and set writable directories for Matplotlib and Transformers
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
MPLCONFIGDIR=$HOME/.config/matplotlib \
TRANSFORMERS_CACHE=$HOME/.cache/huggingface/hub
# Prepare application directory
WORKDIR $HOME/app
COPY --chown=user . $HOME/app
# Setup application environment
WORKDIR /code
RUN git lfs clone https://huggingface.co/AskUI/pta-text-0.1 /code/model/
COPY . .
CMD ["python3", "app.py"]
|