adityaiiitr commited on
Commit
bf1885a
·
verified ·
1 Parent(s): a27a468

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -19
Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
  # Use an official Python runtime as a parent image
2
- FROM python:3.9
3
 
4
  # Set the working directory in the container
5
  WORKDIR /app
@@ -11,21 +11,13 @@ COPY . /app
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
  # Download and install Chrome WebDriver
14
- RUN apt-get install libnss3\
15
- libnspr4\
16
- libdbus-1-3\
17
- libatk1.0-0\
18
- libatk-bridge2.0-0\
19
- libcups2\
20
- libdrm2\
21
- libxkbcommon0\
22
- libatspi2.0-0\
23
- libxcomposite1\
24
- libxdamage1\
25
- libxfixes3\
26
- libxrandr2\
27
- libgbm1\
28
- libasound2
29
 
30
  RUN playwright install chromium
31
 
@@ -33,8 +25,7 @@ RUN playwright install chromium
33
  ENV CHROME_BIN=/usr/bin/chromium
34
  ENV CHROME_PATH=/usr/lib/chromium/
35
 
36
- # Expose the port the app runs on
37
  EXPOSE 7860
38
 
39
- # Run the command to start the FastAPI server
40
- CMD ["python", "main.py"]
 
1
  # Use an official Python runtime as a parent image
2
+ FROM mcr.microsoft.com/playwright/python:v1.40.0-jammy
3
 
4
  # Set the working directory in the container
5
  WORKDIR /app
 
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
  # Download and install Chrome WebDriver
14
+ RUN apt-get update && \
15
+ apt-get install -y wget unzip && \
16
+ wget -q -O /tmp/chromedriver.zip https://chromedriver.storage.googleapis.com/94.0.4606.61/chromedriver_linux64.zip && \
17
+ unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/ && \
18
+ rm /tmp/chromedriver.zip && \
19
+ apt-get remove -y wget unzip && \
20
+ rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
21
 
22
  RUN playwright install chromium
23
 
 
25
  ENV CHROME_BIN=/usr/bin/chromium
26
  ENV CHROME_PATH=/usr/lib/chromium/
27
 
 
28
  EXPOSE 7860
29
 
30
+ # Run app.py when the container launches
31
+ CMD ["python","main.py"]