Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +16 -4
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
FROM python:3.
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
@@ -8,13 +8,25 @@ RUN apt-get update && apt-get install -y \
|
|
| 8 |
git \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
COPY requirements.txt ./
|
| 12 |
COPY src/ ./src/
|
| 13 |
-
|
| 14 |
-
RUN pip3 install -r requirements.txt
|
| 15 |
|
| 16 |
EXPOSE 8501
|
| 17 |
|
| 18 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 19 |
|
| 20 |
-
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 8 |
git \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
+
# Set HOME so Streamlit & HuggingFace use /app
|
| 12 |
+
ENV HOME=/app
|
| 13 |
+
ENV STREAMLIT_HOME=$HOME/.streamlit
|
| 14 |
+
ENV TRANSFORMERS_CACHE=$HOME/.cache/huggingface
|
| 15 |
+
ENV HF_HOME=$HOME/.cache/huggingface
|
| 16 |
+
ENV HF_DATASETS_CACHE=$HOME/.cache/huggingface
|
| 17 |
+
ENV HF_METRICS_CACHE=$HOME/.cache/huggingface
|
| 18 |
+
|
| 19 |
+
# Create writable dirs
|
| 20 |
+
RUN mkdir -p $HOME/.streamlit $HOME/.cache/huggingface && chmod -R 777 $HOME/.streamlit $HOME/.cache
|
| 21 |
+
RUN mkdir -p /tmp && chmod -R 777 /tmp
|
| 22 |
+
|
| 23 |
COPY requirements.txt ./
|
| 24 |
COPY src/ ./src/
|
| 25 |
+
RUN pip3 install --upgrade pip setuptools wheel
|
| 26 |
+
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 27 |
|
| 28 |
EXPOSE 8501
|
| 29 |
|
| 30 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 31 |
|
| 32 |
+
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableCORS=false", "--server.enableXsrfProtection=false"]
|