Spaces:
Sleeping
Sleeping
Kevin King
commited on
Commit
·
b63fd62
1
Parent(s):
f33721e
fix: move libgl1-mesa-glx installation to a separate RUN command
Browse files- Dockerfile +10 -1
Dockerfile
CHANGED
|
@@ -2,6 +2,7 @@ FROM python:3.11-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
build-essential \
|
| 7 |
curl \
|
|
@@ -9,13 +10,21 @@ RUN apt-get update && apt-get install -y \
|
|
| 9 |
git \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
COPY requirements.txt ./
|
| 13 |
COPY src/ ./src/
|
| 14 |
-
|
| 15 |
RUN pip3 install -r requirements.txt
|
| 16 |
|
|
|
|
| 17 |
EXPOSE 8501
|
| 18 |
|
|
|
|
| 19 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 20 |
|
|
|
|
| 21 |
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install base system dependencies
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
build-essential \
|
| 8 |
curl \
|
|
|
|
| 10 |
git \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
+
# === THIS IS THE NEW LINE TO FIX THE ERROR ===
|
| 14 |
+
# Force install the missing library required by OpenCV
|
| 15 |
+
RUN apt-get install -y libgl1-mesa-glx
|
| 16 |
+
# ============================================
|
| 17 |
+
|
| 18 |
+
# Copy and install Python requirements
|
| 19 |
COPY requirements.txt ./
|
| 20 |
COPY src/ ./src/
|
|
|
|
| 21 |
RUN pip3 install -r requirements.txt
|
| 22 |
|
| 23 |
+
# Expose the port Streamlit will run on
|
| 24 |
EXPOSE 8501
|
| 25 |
|
| 26 |
+
# Healthcheck to ensure the app is responsive
|
| 27 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 28 |
|
| 29 |
+
# Command to run the Streamlit application
|
| 30 |
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|