lavanjv commited on
Commit
fd71755
·
1 Parent(s): 8d66d37

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -8
Dockerfile CHANGED
@@ -4,14 +4,6 @@ FROM python:3.9
4
  # Step 2: Set the working directory inside the container
5
  WORKDIR /app
6
 
7
- # Create a non-root user
8
- RUN useradd -ms /bin/bash myuser
9
-
10
- # Give the user ownership of the working directory and home directory
11
- RUN chown -R myuser:myuser /app /home/myuser
12
-
13
- # Switch to the non-root user
14
- USER myuser
15
  # Step 3: Copy the application files to the container
16
  COPY . /app
17
 
@@ -21,5 +13,15 @@ RUN pip install -r requirements.txt
21
  # Step 5: Expose the necessary port
22
  EXPOSE 7860
23
 
 
 
 
 
 
 
 
 
 
 
24
  # Step 6: Define the entry point command
25
  CMD ["flask", "run", "--host=0.0.0.0", "--port=7860"]
 
4
  # Step 2: Set the working directory inside the container
5
  WORKDIR /app
6
 
 
 
 
 
 
 
 
 
7
  # Step 3: Copy the application files to the container
8
  COPY . /app
9
 
 
13
  # Step 5: Expose the necessary port
14
  EXPOSE 7860
15
 
16
+ # Create a non-root user and grant read-write permissions
17
+ RUN useradd -ms /bin/bash myuser
18
+ RUN chown -R myuser:myuser /app
19
+
20
+ # Change permissions of /app directory
21
+ RUN chmod -R 777 /app
22
+
23
+ # Switch to the non-root user
24
+ USER myuser
25
+
26
  # Step 6: Define the entry point command
27
  CMD ["flask", "run", "--host=0.0.0.0", "--port=7860"]