Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -7
Dockerfile
CHANGED
|
@@ -1,17 +1,20 @@
|
|
| 1 |
-
#
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
-
# Keep Python output unbuffered, avoid .pyc
|
| 5 |
ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1
|
| 6 |
-
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
-
# Install Python deps
|
| 10 |
COPY requirements.txt .
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
-
# Copy your app
|
| 14 |
COPY . .
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dockerfile (minimal, robust)
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
|
|
|
| 4 |
ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1
|
|
|
|
| 5 |
WORKDIR /app
|
| 6 |
|
|
|
|
| 7 |
COPY requirements.txt .
|
| 8 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 9 |
|
|
|
|
| 10 |
COPY . .
|
| 11 |
|
| 12 |
+
# Use a small shell so we can unset the bad env var at runtime
|
| 13 |
+
SHELL ["/bin/bash", "-lc"]
|
| 14 |
+
|
| 15 |
+
# Fallback port if HF doesn't inject $PORT for some reason
|
| 16 |
+
ENV PORT=8501
|
| 17 |
+
|
| 18 |
+
# 1) Unset STREAMLIT_SERVER_PORT so Streamlit won't choke on an empty value
|
| 19 |
+
# 2) Run Streamlit binding to the HF $PORT
|
| 20 |
+
CMD unset STREAMLIT_SERVER_PORT; exec streamlit run app.py --server.port=${PORT} --server.address=0.0.0.0
|