Harshb11 commited on
Commit
07e0627
·
verified ·
1 Parent(s): 0df9b50

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -34
Dockerfile CHANGED
@@ -1,54 +1,34 @@
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++ \
18
  wget \
19
  curl \
20
- git \
21
- build-essential \
22
- libglib2.0-0 \
23
- libsm6 \
24
- libxrender1 \
25
- libxext6 \
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"]
 
1
+ # Base lightweight image
2
+ FROM python:3.10-slim
 
 
3
 
4
+ # Avoid interactive prompts
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
7
+ # Working directory
8
  WORKDIR /app
9
 
10
+ # System dependencies
 
 
11
  RUN apt-get update && apt-get install -y \
12
+ build-essential \
13
+ git \
14
  wget \
15
  curl \
 
 
 
 
 
 
 
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
+ # Copy requirements and install
 
 
19
  COPY requirements.txt .
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
+ # Copy all app files
 
 
 
 
 
23
  COPY . .
24
 
25
  # Expose Streamlit port
26
  EXPOSE 7860
27
 
28
+ # Streamlit environment variables
29
+ ENV STREAMLIT_SERVER_HEADLESS=true \
30
+ STREAMLIT_SERVER_PORT=7860 \
31
+ STREAMLIT_SERVER_ENABLE_CORS=false
32
 
33
+ # Run Streamlit
 
 
34
  CMD ["streamlit", "run", "app.py"]