Spaces:
Sleeping
Sleeping
Davide Panza
commited on
Update Dockerfile
Browse files- Dockerfile +9 -3
Dockerfile
CHANGED
|
@@ -11,19 +11,25 @@ RUN apt-get update && apt-get install -y \
|
|
| 11 |
git \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
# Copy app and config files
|
| 15 |
COPY app/ ./
|
| 16 |
COPY requirements.txt ./
|
| 17 |
|
| 18 |
-
# Copy nltk_data folder into /app/nltk_data
|
| 19 |
-
COPY nltk_data /app/nltk_data
|
| 20 |
-
|
| 21 |
# Install Python dependencies
|
| 22 |
RUN pip3 install -r requirements.txt
|
| 23 |
|
| 24 |
# Expose the default Streamlit port
|
| 25 |
EXPOSE 8501
|
| 26 |
|
|
|
|
|
|
|
|
|
|
| 27 |
# Healthcheck endpoint for Spaces
|
| 28 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 29 |
|
|
|
|
| 11 |
git \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Create the .streamlit directory to avoid permission errors
|
| 15 |
+
RUN mkdir -p /app/.streamlit
|
| 16 |
+
|
| 17 |
+
# Copy .streamlit config folder (including config.toml)
|
| 18 |
+
COPY .streamlit/ .streamlit/
|
| 19 |
+
|
| 20 |
# Copy app and config files
|
| 21 |
COPY app/ ./
|
| 22 |
COPY requirements.txt ./
|
| 23 |
|
|
|
|
|
|
|
|
|
|
| 24 |
# Install Python dependencies
|
| 25 |
RUN pip3 install -r requirements.txt
|
| 26 |
|
| 27 |
# Expose the default Streamlit port
|
| 28 |
EXPOSE 8501
|
| 29 |
|
| 30 |
+
# Set environment variable so Streamlit uses the writable config directory
|
| 31 |
+
ENV STREAMLIT_CONFIG_DIR=/app/.streamlit
|
| 32 |
+
|
| 33 |
# Healthcheck endpoint for Spaces
|
| 34 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 35 |
|