Harshb11 commited on
Commit
895004d
·
verified ·
1 Parent(s): 8b6717f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -35
Dockerfile CHANGED
@@ -1,44 +1,18 @@
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"]
 
1
+ # Use official Python lightweight image
2
+ FROM python:3.11-slim
3
 
4
+ # Set working directory
 
 
 
5
  WORKDIR /app
6
 
7
+ # Copy files
8
+ COPY app.py .
 
 
 
 
 
 
 
 
 
 
 
 
9
  COPY requirements.txt .
10
 
11
+ # Install dependencies
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
 
 
 
 
 
 
14
  # Expose port
15
+ EXPOSE 8501
 
 
 
 
 
16
 
17
+ # Run Streamlit
18
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]