Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +30 -7
Dockerfile
CHANGED
|
@@ -1,18 +1,41 @@
|
|
| 1 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
COPY requirements.txt .
|
| 10 |
|
| 11 |
-
# Install dependencies
|
| 12 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
| 14 |
-
#
|
|
|
|
|
|
|
|
|
|
| 15 |
EXPOSE 8501
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
|
| 1 |
+
# -------------------------------
|
| 2 |
+
# Lightweight Dockerfile for MCA Comment Analyzer Demo
|
| 3 |
+
# -------------------------------
|
| 4 |
+
|
| 5 |
+
# Use official Python slim image (lightweight)
|
| 6 |
FROM python:3.11-slim
|
| 7 |
|
| 8 |
# Set working directory
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
+
# Prevent Python from writing pyc files
|
| 12 |
+
ENV PYTHONDONTWRITEBYTECODE=1
|
| 13 |
+
ENV PYTHONUNBUFFERED=1
|
| 14 |
+
|
| 15 |
+
# Set Streamlit config to avoid cache warnings
|
| 16 |
+
ENV MPLCONFIGDIR=/tmp/.matplotlib
|
| 17 |
+
ENV STREAMLIT_BROWSER_GATHERUSAGESTATS=false
|
| 18 |
+
|
| 19 |
+
# Install system dependencies for Python packages
|
| 20 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 21 |
+
build-essential \
|
| 22 |
+
git \
|
| 23 |
+
wget \
|
| 24 |
+
curl \
|
| 25 |
+
unzip \
|
| 26 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 27 |
+
|
| 28 |
+
# Copy requirements first (for Docker caching)
|
| 29 |
COPY requirements.txt .
|
| 30 |
|
| 31 |
+
# Install Python dependencies (CPU-only)
|
| 32 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 33 |
|
| 34 |
+
# Copy app code
|
| 35 |
+
COPY . .
|
| 36 |
+
|
| 37 |
+
# Expose Streamlit default port
|
| 38 |
EXPOSE 8501
|
| 39 |
|
| 40 |
+
# Command to run Streamlit app
|
| 41 |
+
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableCORS=false"]
|