garvitcpp commited on
Commit
cf4e59e
·
verified ·
1 Parent(s): ebb0ab7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +42 -0
Dockerfile CHANGED
@@ -1,11 +1,53 @@
1
  FROM python:3.9-slim
2
 
 
3
  WORKDIR /code
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  COPY ./requirements.txt /code/requirements.txt
6
 
 
7
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
 
 
 
 
 
 
 
9
  COPY ./ /code/
10
 
 
11
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.9-slim
2
 
3
+ # Set working directory
4
  WORKDIR /code
5
 
6
+ # Install system dependencies required for Playwright
7
+ RUN apt-get update && apt-get install -y \
8
+ wget \
9
+ gnupg \
10
+ ca-certificates \
11
+ fonts-liberation \
12
+ libappindicator3-1 \
13
+ libasound2 \
14
+ libatk-bridge2.0-0 \
15
+ libatk1.0-0 \
16
+ libcups2 \
17
+ libdbus-1-3 \
18
+ libdrm2 \
19
+ libgbm1 \
20
+ libgtk-3-0 \
21
+ libnspr4 \
22
+ libnss3 \
23
+ libx11-xcb1 \
24
+ libxcb1 \
25
+ libxcomposite1 \
26
+ libxdamage1 \
27
+ libxext6 \
28
+ libxfixes3 \
29
+ libxrandr2 \
30
+ xvfb \
31
+ libpango-1.0-0 \
32
+ libpangocairo-1.0-0 \
33
+ xauth \
34
+ --no-install-recommends \
35
+ && apt-get clean \
36
+ && rm -rf /var/lib/apt/lists/*
37
+
38
+ # Copy requirements file
39
  COPY ./requirements.txt /code/requirements.txt
40
 
41
+ # Install Python dependencies
42
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
43
 
44
+ # Install Playwright and browsers
45
+ RUN pip install playwright && \
46
+ playwright install chromium && \
47
+ playwright install-deps
48
+
49
+ # Copy application code
50
  COPY ./ /code/
51
 
52
+ # Run the application
53
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]