Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +3 -6
Dockerfile
CHANGED
|
@@ -1,14 +1,11 @@
|
|
| 1 |
# 1. Base Image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
-
# 2. Set environment variables
|
| 5 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 6 |
ENV PYTHONUNBUFFERED=1
|
| 7 |
-
# Tell Streamlit and HF Hub to use a writable directory
|
| 8 |
-
ENV STREAMLIT_HOME=/app/.streamlit
|
| 9 |
-
ENV HF_HOME=/app/.cache/huggingface
|
| 10 |
|
| 11 |
-
# 3. Install
|
| 12 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 13 |
libgl1 \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
|
@@ -26,5 +23,5 @@ COPY . .
|
|
| 26 |
# 7. Expose the correct Hugging Face Space port
|
| 27 |
EXPOSE 7860
|
| 28 |
|
| 29 |
-
# 8. Entrypoint with all necessary flags
|
| 30 |
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true"]
|
|
|
|
| 1 |
# 1. Base Image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
+
# 2. Set environment variables for a non-interactive server
|
| 5 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 6 |
ENV PYTHONUNBUFFERED=1
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
# 3. Install the single critical system dependency for OpenCV
|
| 9 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 10 |
libgl1 \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
| 23 |
# 7. Expose the correct Hugging Face Space port
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
+
# 8. Entrypoint with all necessary flags to prevent permission and connection errors
|
| 27 |
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true"]
|