shethjenil commited on
Commit
dc3836b
·
verified ·
1 Parent(s): 4f0ca57

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -0
Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11
2
+
3
+ # Create a non-root user
4
+ RUN useradd -ms /bin/bash myuser
5
+
6
+ # Set the working directory
7
+ WORKDIR /code
8
+
9
+ # Copy the project files
10
+ COPY . .
11
+
12
+ # Install Python dependencies
13
+ RUN pip install flask requests
14
+
15
+ # Change ownership of the code directory to the non-root user
16
+ RUN chown -R myuser:myuser /code
17
+
18
+ # Switch to the non-root user
19
+ USER myuser
20
+
21
+ # Set the command to run your application
22
+ CMD ["python", "app.py"]