Harshb11 commited on
Commit
6148c31
Β·
verified Β·
1 Parent(s): 93c7fd1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -13
Dockerfile CHANGED
@@ -1,13 +1,17 @@
1
- # βœ… Base image with Python 3.9 slim
 
 
2
  FROM python:3.9-slim
3
 
4
- # Prevent interactive prompts during package installs
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
7
  # Set working directory
8
  WORKDIR /app
9
 
10
- # βœ… Install system dependencies (needed for matplotlib, wordcloud etc.)
 
 
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
- # βœ… Copy requirements.txt first (cache optimization)
 
 
26
  COPY requirements.txt .
27
-
28
- # βœ… Install Python dependencies
29
  RUN pip install --no-cache-dir -r requirements.txt
30
 
31
- # βœ… Download NLTK stopwords at build time
32
  RUN python -m nltk.downloader stopwords
33
 
34
- # βœ… Copy the source code into container
 
 
35
  COPY . .
36
 
37
- # βœ… Expose Streamlit port
38
  EXPOSE 7860
39
 
40
- # βœ… Environment variables for Streamlit
41
  ENV STREAMLIT_SERVER_PORT=7860 \
42
  STREAMLIT_SERVER_ADDRESS=0.0.0.0 \
43
- STREAMLIT_BROWSER_GATHERUSAGESTATS=false
44
 
45
- # βœ… Run Streamlit app
46
- CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
 
 
 
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"]