Harshb11 commited on
Commit
7e4d4f7
·
verified ·
1 Parent(s): 8300f23

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -21
Dockerfile CHANGED
@@ -1,41 +1,35 @@
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"]
 
1
+ # ---- Base image
 
 
 
 
2
  FROM python:3.11-slim
3
 
4
+ # ---- Set working directory
5
  WORKDIR /app
6
 
7
+ # ---- Avoid warnings and set env for matplotlib
 
8
  ENV PYTHONUNBUFFERED=1
 
 
9
  ENV MPLCONFIGDIR=/tmp/.matplotlib
10
+ ENV DEBIAN_FRONTEND=noninteractive
11
 
12
+ # ---- System dependencies
13
+ RUN apt-get update && \
14
+ apt-get install -y --no-install-recommends \
15
  build-essential \
 
16
  wget \
17
+ git \
18
  curl \
19
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
 
20
 
21
+ # ---- Copy requirements
22
  COPY requirements.txt .
23
 
24
+ # ---- Install Python dependencies
25
+ RUN pip install --no-cache-dir --upgrade pip
26
  RUN pip install --no-cache-dir -r requirements.txt
27
 
28
+ # ---- Copy app files
29
  COPY . .
30
 
31
+ # ---- Expose Streamlit default port
32
  EXPOSE 8501
33
 
34
+ # ---- Command to run Streamlit app
35
  CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableCORS=false"]