Update Dockerfile
Browse files- Dockerfile +6 -3
Dockerfile
CHANGED
|
@@ -9,17 +9,20 @@ RUN apt-get update && apt-get install -y \
|
|
| 9 |
git \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
-
# Copy requirements
|
| 13 |
COPY requirements.txt ./
|
| 14 |
-
|
|
|
|
| 15 |
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
# Copy your source code
|
| 18 |
COPY src/ ./src/
|
| 19 |
|
| 20 |
-
#
|
| 21 |
EXPOSE 7860
|
| 22 |
|
|
|
|
| 23 |
HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health
|
| 24 |
|
|
|
|
| 25 |
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
|
|
|
| 9 |
git \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
+
# Copy requirements file first
|
| 13 |
COPY requirements.txt ./
|
| 14 |
+
|
| 15 |
+
# Install exactly what is in your requirements.txt (no hardcoded conflicts!)
|
| 16 |
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
# Copy your source code
|
| 19 |
COPY src/ ./src/
|
| 20 |
|
| 21 |
+
# Expose the specific port Hugging Face Spaces requires
|
| 22 |
EXPOSE 7860
|
| 23 |
|
| 24 |
+
# Healthcheck to ensure Streamlit is running correctly
|
| 25 |
HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health
|
| 26 |
|
| 27 |
+
# Start Streamlit on the correct Hugging Face port
|
| 28 |
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|