roshcheeku commited on
Commit
0bb50ed
·
verified ·
1 Parent(s): 379427d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -7
Dockerfile CHANGED
@@ -1,20 +1,23 @@
1
- FROM python:3.9
2
 
3
  # Create a non-root user with UID 1000
4
  RUN useradd -m -u 1000 user
5
 
6
- # Set the working directory
7
  WORKDIR /app
8
 
9
- # Copy and install dependencies
10
  COPY --chown=user requirements.txt requirements.txt
11
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
12
 
13
- # Copy the application code
14
  COPY --chown=user . .
15
 
16
- # Expose the port the app runs on
 
 
 
17
  EXPOSE 7860
18
 
19
- # Command to run the application
20
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.9-slim
2
 
3
  # Create a non-root user with UID 1000
4
  RUN useradd -m -u 1000 user
5
 
6
+ # Set working directory
7
  WORKDIR /app
8
 
9
+ # Copy dependencies
10
  COPY --chown=user requirements.txt requirements.txt
11
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
12
 
13
+ # Copy the entire project
14
  COPY --chown=user . .
15
 
16
+ # Set the user
17
+ USER user
18
+
19
+ # Expose the port used by Flask
20
  EXPOSE 7860
21
 
22
+ # Run the Flask app
23
+ CMD ["python", "app.py"]