Spaces:
Runtime error
Runtime error
srivatsavdamaraju
commited on
Commit
•
1e6188d
1
Parent(s):
485f8d7
Update Dockerfile
Browse files- Dockerfile +22 -11
Dockerfile
CHANGED
@@ -1,18 +1,29 @@
|
|
1 |
-
|
2 |
-
FROM python:3.9
|
3 |
|
4 |
-
#
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
7 |
|
|
|
|
|
8 |
|
|
|
|
|
9 |
|
|
|
|
|
10 |
|
11 |
-
# Install
|
12 |
-
RUN pip install
|
13 |
|
14 |
-
#
|
15 |
-
|
16 |
|
17 |
-
# Run the
|
18 |
-
CMD ["gunicorn", "
|
|
|
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"]
|