Spaces:
Sleeping
Sleeping
gitlost-murali
commited on
Commit
•
d11d533
1
Parent(s):
27b79c7
add cache to path
Browse files- Dockerfile +7 -5
Dockerfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
FROM ubuntu:22.04
|
2 |
|
3 |
-
# Install
|
4 |
RUN apt-get update && apt-get install -y curl git python3 python3-pip && \
|
5 |
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
|
6 |
apt-get install -y git-lfs
|
@@ -9,18 +9,20 @@ RUN apt-get update && apt-get install -y curl git python3 python3-pip && \
|
|
9 |
COPY ./requirements.txt /code/requirements.txt
|
10 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
11 |
|
12 |
-
# Create a user
|
13 |
RUN useradd -m -u 1000 user
|
14 |
USER user
|
15 |
ENV HOME=/home/user \
|
16 |
-
PATH=/home/user/.local/bin:$PATH
|
|
|
|
|
17 |
|
|
|
18 |
WORKDIR $HOME/app
|
19 |
COPY --chown=user . $HOME/app
|
20 |
|
21 |
-
#
|
22 |
WORKDIR /code
|
23 |
-
|
24 |
RUN git lfs clone https://huggingface.co/AskUI/pta-text-0.1 /code/model/
|
25 |
COPY . .
|
26 |
|
|
|
1 |
FROM ubuntu:22.04
|
2 |
|
3 |
+
# Install necessary packages
|
4 |
RUN apt-get update && apt-get install -y curl git python3 python3-pip && \
|
5 |
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
|
6 |
apt-get install -y git-lfs
|
|
|
9 |
COPY ./requirements.txt /code/requirements.txt
|
10 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
11 |
|
12 |
+
# Create a non-root user and set writable directories for Matplotlib and Transformers
|
13 |
RUN useradd -m -u 1000 user
|
14 |
USER user
|
15 |
ENV HOME=/home/user \
|
16 |
+
PATH=/home/user/.local/bin:$PATH \
|
17 |
+
MPLCONFIGDIR=$HOME/.config/matplotlib \
|
18 |
+
TRANSFORMERS_CACHE=$HOME/.cache/huggingface/hub
|
19 |
|
20 |
+
# Prepare application directory
|
21 |
WORKDIR $HOME/app
|
22 |
COPY --chown=user . $HOME/app
|
23 |
|
24 |
+
# Setup application environment
|
25 |
WORKDIR /code
|
|
|
26 |
RUN git lfs clone https://huggingface.co/AskUI/pta-text-0.1 /code/model/
|
27 |
COPY . .
|
28 |
|