tuan243 commited on
Commit
ae13880
·
verified ·
1 Parent(s): 61d29c1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -9
Dockerfile CHANGED
@@ -5,6 +5,12 @@ RUN pwd && ls -l
5
  # Create a user with UID 1000
6
  RUN useradd -m -u 1000 user
7
 
 
 
 
 
 
 
8
  # Switch to the user
9
  USER user
10
 
@@ -17,15 +23,6 @@ WORKDIR /home/user
17
  # Copy the application files into the user's home directory
18
  COPY --chown=user:user . /home/user
19
 
20
- # Copy the requirements file to the /code directory
21
- COPY ./requirements.txt /code/requirements.txt
22
-
23
- # Install the Python dependencies
24
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt && rm -rf /root/.cache
25
-
26
- # Create a directory for cache and set permissions (có thể không cần thiết)
27
- # RUN mkdir -p $HOME/.cache && chmod 777 $HOME/.cache (Thử bỏ dòng này nếu không gặp vấn đề)
28
-
29
  # Set the working directory for the application
30
  WORKDIR /home/user
31
 
 
5
  # Create a user with UID 1000
6
  RUN useradd -m -u 1000 user
7
 
8
+ # Copy the requirements file to the /code directory
9
+ COPY ./requirements.txt /code/requirements.txt
10
+
11
+ # Install the Python dependencies with root and clean up cache
12
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt && rm -rf /root/.cache
13
+
14
  # Switch to the user
15
  USER user
16
 
 
23
  # Copy the application files into the user's home directory
24
  COPY --chown=user:user . /home/user
25
 
 
 
 
 
 
 
 
 
 
26
  # Set the working directory for the application
27
  WORKDIR /home/user
28