Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +27 -20
Dockerfile
CHANGED
|
@@ -1,20 +1,27 @@
|
|
| 1 |
-
# Use an official Python runtime as a parent image
|
| 2 |
-
FROM python:3.8-slim
|
| 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
|
| 11 |
-
RUN
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official Python runtime as a parent image
|
| 2 |
+
FROM python:3.8-slim
|
| 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 system dependencies required for OpenCV and other libraries
|
| 11 |
+
RUN apt-get update && \
|
| 12 |
+
apt-get install -y \
|
| 13 |
+
libgl1-mesa-glx \
|
| 14 |
+
libglib2.0-0 \
|
| 15 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
+
|
| 17 |
+
# Install any needed packages specified in requirements.txt
|
| 18 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
+
|
| 20 |
+
# Make port 8080 available to the world outside this container
|
| 21 |
+
EXPOSE 8080
|
| 22 |
+
|
| 23 |
+
# Define environment variable
|
| 24 |
+
ENV FLASK_APP=app.py
|
| 25 |
+
|
| 26 |
+
# Run app.py when the container launches
|
| 27 |
+
CMD ["flask", "run", "--host=0.0.0.0", "--port=8080"]
|