srivatsavdamaraju commited on
Commit
1e6188d
1 Parent(s): 485f8d7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -11
Dockerfile CHANGED
@@ -1,18 +1,29 @@
1
- ## Use the official Python image
2
- FROM python:3.9
3
 
4
- # Set the working directory in the container
5
- # Copy the requirements file into the container
6
- COPY requirements.txt ./requirements.txt
 
 
 
 
 
7
 
 
 
8
 
 
 
9
 
 
 
10
 
11
- # Install Python packages from requirements.txt
12
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
 
14
- # Copy the current directory contents into the container
15
- COPY . .
16
 
17
- # Run the application using gunicorn with eventlet worker
18
- CMD ["gunicorn", "-k", "eventlet", "-b", "0.0.0.0:7860", "app:app"]
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
 
4
+ # Install system dependencies for OpenCV, including libGL.so.1 and others
5
+ RUN apt-get update && apt-get install -y \
6
+ libgl1-mesa-glx \
7
+ libglib2.0-0 \
8
+ libsm6 \
9
+ libxext6 \
10
+ libxrender1 \
11
+ && rm -rf /var/lib/apt/lists/*
12
 
13
+ # Set the working directory in the container
14
+ WORKDIR /app
15
 
16
+ # Copy the current directory contents into the container at /app
17
+ COPY . /app
18
 
19
+ # Install any needed packages specified in requirements.txt
20
+ RUN pip install --no-cache-dir -r requirements.txt
21
 
22
+ # Install Gunicorn
23
+ RUN pip install gunicorn
24
 
25
+ # Expose the port the app runs on
26
+ EXPOSE 5000
27
 
28
+ # Run the Gunicorn server when the container launches
29
+ CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"]