Harshb11 commited on
Commit
d785ac6
·
verified ·
1 Parent(s): 411509e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -12
Dockerfile CHANGED
@@ -1,34 +1,44 @@
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"]
 
1
+ # Base image
2
  FROM python:3.10-slim
3
 
4
+ # Prevent prompts
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
7
+ # Set working dir
8
  WORKDIR /app
9
 
10
+ # Install system deps for matplotlib, wordcloud, torch
11
  RUN apt-get update && apt-get install -y \
12
  build-essential \
13
  git \
14
  wget \
15
  curl \
16
+ libglib2.0-0 \
17
+ libsm6 \
18
+ libxrender1 \
19
+ libxext6 \
20
+ libgl1 \
21
  && rm -rf /var/lib/apt/lists/*
22
 
23
+ # Copy requirements first
24
  COPY requirements.txt .
25
+
26
+ # Install python deps
27
  RUN pip install --no-cache-dir -r requirements.txt
28
 
29
+ # Set MPLCONFIGDIR for matplotlib
30
+ ENV MPLCONFIGDIR=/tmp/.matplotlib
31
+
32
+ # Copy app
33
  COPY . .
34
 
35
+ # Expose port
36
  EXPOSE 7860
37
 
38
+ # Streamlit env
39
+ ENV STREAMLIT_SERVER_PORT=7860
40
+ ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
41
+ ENV STREAMLIT_SERVER_ENABLECORS=false
42
 
43
+ # Run app
44
  CMD ["streamlit", "run", "app.py"]