anakin87 commited on
Commit
9ca8b26
·
1 Parent(s): 073bc44

setup permission

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -5
Dockerfile CHANGED
@@ -3,14 +3,27 @@ FROM deepset/haystack:base-cpu-v1.23.0
3
  COPY requirements.txt .
4
  RUN pip install -r requirements.txt
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  # copy only the application files in /app
7
  # Streamlit does not allow running an app from the root directory
8
- COPY Rock_fact_checker.py app/
9
- COPY pages app/pages
10
- COPY app_utils app/app_utils
11
- COPY data app/data
12
 
13
- WORKDIR app
14
 
15
  EXPOSE 8501
16
 
 
3
  COPY requirements.txt .
4
  RUN pip install -r requirements.txt
5
 
6
+ # Set up a new user named "user" with user ID 1000
7
+ RUN useradd -m -u 1000 user
8
+
9
+ # Switch to the "user" user
10
+ USER user
11
+
12
+ # Set home to the user's home directory
13
+ ENV HOME=/home/user \
14
+ PATH=/home/user/.local/bin:$PATH
15
+
16
+ # Set the working directory to the user's home directory
17
+ WORKDIR $HOME/app
18
+
19
  # copy only the application files in /app
20
  # Streamlit does not allow running an app from the root directory
21
+ COPY --chown=user Rock_fact_checker.py $HOME/app/
22
+ COPY --chown=user pages $HOME/app/pages
23
+ COPY --chown=user app_utils $HOME/app/app_utils
24
+ COPY --chown=user data $HOME/app/data
25
 
26
+ WORKDIR $HOME/app
27
 
28
  EXPOSE 8501
29