muddasser commited on
Commit
cc04d1e
·
verified ·
1 Parent(s): 6b33a86

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -24
Dockerfile CHANGED
@@ -1,6 +1,9 @@
1
- FROM python:3.10-slim
2
 
3
- # Install system dependencies including Chrome and ChromeDriver
 
 
 
4
  RUN apt-get update && apt-get install -y \
5
  wget \
6
  gnupg \
@@ -27,32 +30,20 @@ RUN apt-get update && apt-get install -y \
27
  libnspr4 \
28
  libpango-1.0-0 \
29
  libxkbcommon0 \
30
- libxshmfence1
31
-
32
- # Install Chrome
33
- RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
34
- && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
35
- && apt-get update \
36
- && apt-get install -y google-chrome-stable
37
 
38
- # Install ChromeDriver
39
- RUN CHROME_VERSION=$(google-chrome --version | cut -d ' ' -f3 | cut -d '.' -f1) \
40
- && CHROMEDRIVER_VERSION=$(wget -q -O - "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION%.*}") \
41
- && wget -O /tmp/chromedriver.zip "https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip" \
42
- && unzip /tmp/chromedriver.zip -d /usr/bin/ \
43
- && chmod +x /usr/bin/chromedriver
44
 
45
- # Set working directory
 
46
  WORKDIR /app
47
 
48
- # Copy requirements and install Python dependencies
49
- COPY requirements.txt .
50
- RUN pip install --no-cache-dir -r requirements.txt
51
-
52
- # Copy application code
53
- COPY . .
54
-
55
- # Expose port
56
  EXPOSE 8501
57
 
58
  # Run Streamlit
 
1
+ FROM python:3.10-slim-bullseye
2
 
3
+ # Set noninteractive to avoid prompts
4
+ ENV DEBIAN_FRONTEND=noninteractive
5
+
6
+ # Install dependencies
7
  RUN apt-get update && apt-get install -y \
8
  wget \
9
  gnupg \
 
30
  libnspr4 \
31
  libpango-1.0-0 \
32
  libxkbcommon0 \
33
+ libxshmfence1 \
34
+ chromium \
35
+ chromium-driver \
36
+ && rm -rf /var/lib/apt/lists/*
 
 
 
37
 
38
+ # Install Python dependencies
39
+ COPY requirements.txt /tmp/requirements.txt
40
+ RUN pip install --no-cache-dir -r /tmp/requirements.txt
 
 
 
41
 
42
+ # Copy app code
43
+ COPY . /app
44
  WORKDIR /app
45
 
46
+ # Expose Streamlit port
 
 
 
 
 
 
 
47
  EXPOSE 8501
48
 
49
  # Run Streamlit