File size: 827 Bytes
93209fd
27b79c7
da59cbe
 
 
93209fd
 
da59cbe
93209fd
27b79c7
 
 
d11d533
 
 
da59cbe
27b79c7
93209fd
 
 
 
 
 
 
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
# Install system dependencies
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

# Create the code directory and ensure it's owned by the non-root user
RUN mkdir -p /code && chown user:user /code

# Switch to non-root user
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

WORKDIR /code

# Clone the repository using git clone and set up Git LFS
RUN git lfs install && \
    git clone https://huggingface.co/AskUI/pta-text-0.1 ./model

# Copy the rest of your application files
COPY --chown=user . .

CMD ["python3", "app.py"]