gitlost-murali commited on
Commit
93209fd
1 Parent(s): d11d533

update dockerfile to update lfs clone location

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -14
Dockerfile CHANGED
@@ -1,15 +1,12 @@
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
7
 
8
- # Install Python dependencies
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 \
@@ -17,13 +14,13 @@ ENV HOME=/home/user \
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
 
29
  CMD ["python3", "app.py"]
 
1
+ # Install system dependencies
 
 
2
  RUN apt-get update && apt-get install -y curl git python3 python3-pip && \
3
  curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
4
  apt-get install -y git-lfs
5
 
6
+ # Create the code directory and ensure it's owned by the non-root user
7
+ RUN mkdir -p /code && chown user:user /code
 
8
 
9
+ # Switch to non-root user
10
  RUN useradd -m -u 1000 user
11
  USER user
12
  ENV HOME=/home/user \
 
14
  MPLCONFIGDIR=$HOME/.config/matplotlib \
15
  TRANSFORMERS_CACHE=$HOME/.cache/huggingface/hub
16
 
 
 
 
 
 
17
  WORKDIR /code
18
+
19
+ # Clone the repository using git clone and set up Git LFS
20
+ RUN git lfs install && \
21
+ git clone https://huggingface.co/AskUI/pta-text-0.1 ./model
22
+
23
+ # Copy the rest of your application files
24
+ COPY --chown=user . .
25
 
26
  CMD ["python3", "app.py"]