zuehue commited on
Commit
5e25821
·
verified ·
1 Parent(s): 734e350

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ # Create a user with a specified UID to avoid permission issues
4
+ RUN useradd -m -u 1000 user
5
+
6
+ # Set the working directory to the user's home directory
7
+ WORKDIR /app
8
+
9
+ # Install system dependencies (sudo, npm) as root
10
+
11
+ # Copy package.json and package-lock.json to the working directory and set the owner to user
12
+
13
+ # Set the user for subsequent commands
14
+ COPY --chown=user ./main.py main.py
15
+ COPY --chown=user ./r.txt r.txt
16
+ # Install Node.js dependencies
17
+ RUN pip3 install -r r.txt
18
+
19
+ # Copy the rest of the application code to the working directory and set the owner to user
20
+ COPY --chown=user . /app
21
+
22
+ # Ensure the user has write permission to health_data.json
23
+
24
+
25
+ # Expose the port your app runs on
26
+ EXPOSE 7860
27
+
28
+ # Command to run your application
29
+ CMD ["python3", "main.py"]