Gagan0141 commited on
Commit
cb9fc23
·
verified ·
1 Parent(s): f9b0ff7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +46 -10
Dockerfile CHANGED
@@ -1,19 +1,55 @@
1
- FROM python:3.11.5-slim
 
2
 
 
 
 
 
 
3
  WORKDIR /app
4
 
5
- RUN apt-get update && apt-get install -y \
6
- build-essential \
7
- curl \
8
- git \
9
- && rm -rf /var/lib/apt/lists/*
10
 
11
- COPY requirements.txt ./
 
 
12
 
13
- RUN pip3 install -r requirements.txt
 
14
 
 
15
  EXPOSE 8501
16
 
17
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
- ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
1
+ # Use official Python 3.10 image
2
+ FROM python:3.10-slim
3
 
4
+ # Set environment variables to avoid Python buffering and warnings
5
+ ENV PYTHONUNBUFFERED=1
6
+ ENV PYTHONWARNINGS="ignore"
7
+
8
+ # Set working directory
9
  WORKDIR /app
10
 
11
+ # Copy requirements.txt first (for caching)
12
+ COPY requirements.txt .
 
 
 
13
 
14
+ # Upgrade pip and install dependencies
15
+ RUN python -m pip install --upgrade pip \
16
+ && pip install --no-cache-dir -r requirements.txt
17
 
18
+ # Copy the rest of your app
19
+ COPY . .
20
 
21
+ # Expose port for Streamlit
22
  EXPOSE 8501
23
 
24
+ # Command to run Streamlit app
25
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+ # FROM python:3.11.5-slim
38
+
39
+ # WORKDIR /app
40
+
41
+ # RUN apt-get update && apt-get install -y \
42
+ # build-essential \
43
+ # curl \
44
+ # git \
45
+ # && rm -rf /var/lib/apt/lists/*
46
+
47
+ # COPY requirements.txt ./
48
+
49
+ # RUN pip3 install -r requirements.txt
50
+
51
+ # EXPOSE 8501
52
+
53
+ # HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
54
 
55
+ # ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]