Fausto Busuito commited on
Commit
86f7e43
·
1 Parent(s): a4a736c

Application changes

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -10
Dockerfile CHANGED
@@ -1,20 +1,29 @@
1
- # Use the official Python image from the Docker Hub
2
- FROM python:3.9-slim
 
 
 
 
 
 
 
 
 
3
 
4
  # Set the working directory
5
  WORKDIR /app
6
 
7
- # Copy the requirements file into the container
8
- COPY requirements.txt .
9
 
10
- # Install the dependencies
11
- RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- # Copy the rest of the application code into the container
14
- COPY . .
15
 
16
- # Expose the port the app runs on
17
  EXPOSE 5000
18
 
19
- # Run the application
20
  CMD ["python", "run.py"]
 
1
+ # Use the official Python image with version 3.9
2
+ FROM python:3.9
3
+
4
+ # Create a new user to run the application
5
+ RUN useradd -m -u 1000 user
6
+
7
+ # Set the user for subsequent commands
8
+ USER user
9
+
10
+ # Update the PATH environment variable
11
+ ENV PATH="/home/user/.local/bin:$PATH"
12
 
13
  # Set the working directory
14
  WORKDIR /app
15
 
16
+ # Copy the requirements.txt file into the container
17
+ COPY --chown=user ./requirements.txt requirements.txt
18
 
19
+ # Install the dependencies listed in requirements.txt
20
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
21
 
22
+ # Copy the entire project into the container
23
+ COPY --chown=user . /app
24
 
25
+ # Expose the application port (5000) for Hugging Face Spaces
26
  EXPOSE 5000
27
 
28
+ # Set the command to run the application using Flask-SocketIO and eventlet
29
  CMD ["python", "run.py"]