Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +21 -13
Dockerfile
CHANGED
|
@@ -1,13 +1,17 @@
|
|
| 1 |
-
#
|
|
|
|
|
|
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
# Prevent interactive prompts
|
| 5 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
|
| 7 |
# Set working directory
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
-
#
|
|
|
|
|
|
|
| 11 |
RUN apt-get update && apt-get install -y \
|
| 12 |
gcc \
|
| 13 |
g++ \
|
|
@@ -22,25 +26,29 @@ RUN apt-get update && apt-get install -y \
|
|
| 22 |
libgl1 \
|
| 23 |
&& rm -rf /var/lib/apt/lists/*
|
| 24 |
|
| 25 |
-
#
|
|
|
|
|
|
|
| 26 |
COPY requirements.txt .
|
| 27 |
-
|
| 28 |
-
# β
Install Python dependencies
|
| 29 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 30 |
|
| 31 |
-
#
|
| 32 |
RUN python -m nltk.downloader stopwords
|
| 33 |
|
| 34 |
-
#
|
|
|
|
|
|
|
| 35 |
COPY . .
|
| 36 |
|
| 37 |
-
#
|
| 38 |
EXPOSE 7860
|
| 39 |
|
| 40 |
-
#
|
| 41 |
ENV STREAMLIT_SERVER_PORT=7860 \
|
| 42 |
STREAMLIT_SERVER_ADDRESS=0.0.0.0 \
|
| 43 |
-
|
| 44 |
|
| 45 |
-
#
|
| 46 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
# -----------------------------
|
| 2 |
+
# Base image with Python 3.9
|
| 3 |
+
# -----------------------------
|
| 4 |
FROM python:3.9-slim
|
| 5 |
|
| 6 |
+
# Prevent interactive prompts
|
| 7 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 8 |
|
| 9 |
# Set working directory
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
+
# -----------------------------
|
| 13 |
+
# System dependencies for NLTK, Matplotlib, WordCloud
|
| 14 |
+
# -----------------------------
|
| 15 |
RUN apt-get update && apt-get install -y \
|
| 16 |
gcc \
|
| 17 |
g++ \
|
|
|
|
| 26 |
libgl1 \
|
| 27 |
&& rm -rf /var/lib/apt/lists/*
|
| 28 |
|
| 29 |
+
# -----------------------------
|
| 30 |
+
# Copy requirements and install Python packages
|
| 31 |
+
# -----------------------------
|
| 32 |
COPY requirements.txt .
|
|
|
|
|
|
|
| 33 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 34 |
|
| 35 |
+
# Download NLTK stopwords
|
| 36 |
RUN python -m nltk.downloader stopwords
|
| 37 |
|
| 38 |
+
# -----------------------------
|
| 39 |
+
# Copy source code
|
| 40 |
+
# -----------------------------
|
| 41 |
COPY . .
|
| 42 |
|
| 43 |
+
# Expose Streamlit port
|
| 44 |
EXPOSE 7860
|
| 45 |
|
| 46 |
+
# Set Streamlit environment variables
|
| 47 |
ENV STREAMLIT_SERVER_PORT=7860 \
|
| 48 |
STREAMLIT_SERVER_ADDRESS=0.0.0.0 \
|
| 49 |
+
STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
|
| 50 |
|
| 51 |
+
# -----------------------------
|
| 52 |
+
# Command to run Streamlit
|
| 53 |
+
# -----------------------------
|
| 54 |
+
CMD ["streamlit", "run", "app.py"]
|