Prathamesh1420 commited on
Commit
0ac1b30
·
verified ·
1 Parent(s): b691884

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -16
Dockerfile CHANGED
@@ -1,22 +1,20 @@
1
- # Use an official Python runtime as a parent image
2
- FROM python:3.10
3
 
4
- # Set the working directory in the container
5
- WORKDIR /app
 
 
 
 
 
 
6
 
7
- # Copy the current directory contents into the container at /app
8
- COPY . /app
9
 
10
- # Install any needed packages specified in requirements.txt
11
- RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- # Expose the port the app runs on
14
  EXPOSE 7860
15
 
16
- # Define environment variables
17
- ENV FLASK_APP=app.py
18
- ENV FLASK_RUN_HOST=0.0.0.0
19
- ENV FLASK_RUN_PORT=7860
20
-
21
- # Run the application using Gunicorn for better performance
22
- CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
 
1
+ FROM python:3.11.0
 
2
 
3
+ RUN apt-get update && apt-get install -y \
4
+ libgl1 \
5
+ libglib2.0-0 \
6
+ && rm -rf /var/lib/apt/lists/*
7
+
8
+ RUN useradd -m -u 1000 user
9
+ USER user
10
+ ENV PATH="/home/user/.local/bin:$PATH"
11
 
12
+ WORKDIR /app
 
13
 
14
+ COPY --chown=user ./requirements.txt requirements.txt
15
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
16
 
17
+ COPY --chown=user . /app
18
  EXPOSE 7860
19
 
20
+ CMD ["gunicorn","-b","0.0.0.0:7860", "app:app"]