Update Dockerfile
Browse files- Dockerfile +2 -8
Dockerfile
CHANGED
@@ -1,36 +1,30 @@
|
|
1 |
FROM python:3.9-slim
|
2 |
|
3 |
-
# β
|
4 |
ENV PYTHONUNBUFFERED=1 \
|
5 |
PORT=8501 \
|
6 |
HF_HOME=/tmp/huggingface \
|
|
|
7 |
STREAMLIT_HOME=/tmp/.streamlit \
|
8 |
-
STREAMLIT_CONFIG_DIR=/tmp/.streamlit \
|
9 |
STREAMLIT_SERVER_HEADLESS=true \
|
10 |
STREAMLIT_SERVER_PORT=8501 \
|
11 |
STREAMLIT_SERVER_ADDRESS=0.0.0.0
|
12 |
|
13 |
WORKDIR /app
|
14 |
|
15 |
-
# β
Install system dependencies
|
16 |
RUN apt-get update && apt-get install -y \
|
17 |
build-essential \
|
18 |
curl \
|
19 |
git \
|
20 |
&& rm -rf /var/lib/apt/lists/*
|
21 |
|
22 |
-
# β
Copy files
|
23 |
COPY requirements.txt ./
|
24 |
COPY src/ ./src/
|
25 |
|
26 |
-
# β
Install Python packages
|
27 |
RUN pip install --no-cache-dir -r requirements.txt
|
28 |
|
29 |
-
# β
Expose Streamlit port
|
30 |
EXPOSE 8501
|
31 |
|
32 |
-
# β
Healthcheck for Hugging Face Spaces
|
33 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|
34 |
|
35 |
-
# β
Run Streamlit
|
36 |
ENTRYPOINT ["streamlit", "run", "src/app.py"]
|
|
|
1 |
FROM python:3.9-slim
|
2 |
|
3 |
+
# β
Define all writable paths explicitly
|
4 |
ENV PYTHONUNBUFFERED=1 \
|
5 |
PORT=8501 \
|
6 |
HF_HOME=/tmp/huggingface \
|
7 |
+
XDG_CACHE_HOME=/tmp/.cache \
|
8 |
STREAMLIT_HOME=/tmp/.streamlit \
|
|
|
9 |
STREAMLIT_SERVER_HEADLESS=true \
|
10 |
STREAMLIT_SERVER_PORT=8501 \
|
11 |
STREAMLIT_SERVER_ADDRESS=0.0.0.0
|
12 |
|
13 |
WORKDIR /app
|
14 |
|
|
|
15 |
RUN apt-get update && apt-get install -y \
|
16 |
build-essential \
|
17 |
curl \
|
18 |
git \
|
19 |
&& rm -rf /var/lib/apt/lists/*
|
20 |
|
|
|
21 |
COPY requirements.txt ./
|
22 |
COPY src/ ./src/
|
23 |
|
|
|
24 |
RUN pip install --no-cache-dir -r requirements.txt
|
25 |
|
|
|
26 |
EXPOSE 8501
|
27 |
|
|
|
28 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|
29 |
|
|
|
30 |
ENTRYPOINT ["streamlit", "run", "src/app.py"]
|