srivatsavdamaraju commited on
Commit
0b927d0
1 Parent(s): 263e578

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -6
Dockerfile CHANGED
@@ -1,6 +1,11 @@
1
  # Use an official Python runtime as a parent image
2
  FROM python:3.9-slim
3
 
 
 
 
 
 
4
  # Set the working directory in the container
5
  WORKDIR /app
6
 
@@ -10,12 +15,11 @@ COPY . /app
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 5000
15
 
16
- # Define environment variable
17
- ENV FLASK_APP=app.py
18
- ENV FLASK_RUN_HOST=0.0.0.0
19
-
20
- # Run the Flask app when the container launches
21
- CMD ["flask", "run"]
 
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)
5
+ RUN apt-get update && apt-get install -y \
6
+ libgl1-mesa-glx \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
  # Set the working directory in the container
10
  WORKDIR /app
11
 
 
15
  # Install any needed packages specified in requirements.txt
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
+ # Install Gunicorn
19
+ RUN pip install gunicorn
20
+
21
  # Expose the port the app runs on
22
  EXPOSE 5000
23
 
24
+ # Run the Gunicorn server when the container launches
25
+ CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"]