Spaces:
Sleeping
Sleeping
Davide Panza commited on
Update Dockerfile
Browse files- Dockerfile +12 -12
Dockerfile
CHANGED
|
@@ -1,39 +1,39 @@
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
-
# Set working directory to /app inside the container
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
# Install system dependencies
|
| 7 |
RUN apt-get update && apt-get install -y \
|
| 8 |
build-essential \
|
| 9 |
curl \
|
| 10 |
-
software-properties-common \
|
| 11 |
git \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
-
# Create
|
| 15 |
-
RUN mkdir -p /app/.streamlit
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
-
# Copy
|
|
|
|
| 21 |
COPY app/ ./
|
|
|
|
| 22 |
COPY requirements.txt ./
|
| 23 |
|
| 24 |
# Install Python dependencies
|
| 25 |
RUN pip3 install -r requirements.txt
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
|
| 29 |
|
| 30 |
-
#
|
| 31 |
ENV STREAMLIT_CONFIG_DIR=/app/.streamlit
|
| 32 |
ENV STREAMLIT_SERVER_HEADLESS=true
|
| 33 |
ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
|
| 34 |
|
| 35 |
-
|
| 36 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 37 |
|
| 38 |
-
# Run Streamlit with port 8501 (DO NOT override port)
|
| 39 |
ENTRYPOINT ["streamlit", "run", "main.py", "--server.address=0.0.0.0"]
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
# Install system dependencies
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
build-essential \
|
| 8 |
curl \
|
|
|
|
| 9 |
git \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
+
# Create directories
|
| 13 |
+
RUN mkdir -p /app/.streamlit /app/.cache
|
| 14 |
|
| 15 |
+
# Set cache environment variables
|
| 16 |
+
ENV TRANSFORMERS_CACHE=/app/.cache
|
| 17 |
+
ENV HF_HOME=/app/.cache
|
| 18 |
|
| 19 |
+
# Copy files
|
| 20 |
+
COPY .streamlit/ .streamlit/
|
| 21 |
COPY app/ ./
|
| 22 |
+
COPY chromadb_model/ chromadb_model/
|
| 23 |
COPY requirements.txt ./
|
| 24 |
|
| 25 |
# Install Python dependencies
|
| 26 |
RUN pip3 install -r requirements.txt
|
| 27 |
|
| 28 |
+
# Download NLTK data
|
| 29 |
+
RUN python -c "import nltk; nltk.download('punkt'); nltk.download('punkt_tab')"
|
| 30 |
|
| 31 |
+
# Streamlit configuration
|
| 32 |
ENV STREAMLIT_CONFIG_DIR=/app/.streamlit
|
| 33 |
ENV STREAMLIT_SERVER_HEADLESS=true
|
| 34 |
ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
|
| 35 |
|
| 36 |
+
EXPOSE 8501
|
| 37 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 38 |
|
|
|
|
| 39 |
ENTRYPOINT ["streamlit", "run", "main.py", "--server.address=0.0.0.0"]
|