d3evil4 commited on
Commit
eb6d7f3
·
verified ·
1 Parent(s): 1f08f54

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -20
Dockerfile CHANGED
@@ -1,33 +1,29 @@
1
- # Use the official Python image as base
2
  FROM python:3.11-slim
3
 
 
 
 
4
 
5
- # Install OS dependencies for Playwright and Chromium
6
- RUN apt update && apt install -y \
7
  libx11-xcb1 libxcomposite1 libxdamage1 libxrandr2 \
8
  libxss1 libxtst6 libnss3 libatk-bridge2.0-0 \
9
- libgtk-3-0 libxkbcommon0 libxshmfence1 \
10
- libxext6 libxfixes3 libxrender1 libxcb1 \
11
- libxcb-glx0 libxcb-dri3-0 libx11-6 libxcursor1 \
12
- libgdk-pixbuf2.0-0 libpangocairo-1.0-0 \
13
- libcairo-gobject2
14
 
15
-
16
- # Set work directory
17
  WORKDIR /app
18
 
19
- # Copy project files
20
  COPY . .
21
 
22
- # Install Python dependencies
23
- RUN pip install --upgrade pip
24
- RUN pip install fastapi uvicorn playwright nest_asyncio
25
 
26
- # Install Playwright browsers (Chromium only)
27
- RUN playwright install --with-deps chromium
28
- RUN playwright install
29
- # Expose the FastAPI port
30
 
31
- # Command to run the FastAPI app
32
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
33
 
 
 
 
1
  FROM python:3.11-slim
2
 
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+ ENV PYTHONUNBUFFERED=1
5
+ ENV PLAYWRIGHT_BROWSERS_PATH=0
6
 
7
+ # Install OS dependencies
8
+ RUN apt update && apt install -y --no-install-recommends \
9
  libx11-xcb1 libxcomposite1 libxdamage1 libxrandr2 \
10
  libxss1 libxtst6 libnss3 libatk-bridge2.0-0 \
11
+ libgtk-3-0 libxkbcommon0 libxshmfence1 libxext6 \
12
+ libxfixes3 libxrender1 libxcb1 libxcb-glx0 libxcb-dri3-0 \
13
+ libx11-6 libxcursor1 libgdk-pixbuf2.0-0 libpangocairo-1.0-0 \
14
+ libcairo-gobject2 wget ca-certificates && \
15
+ apt clean && rm -rf /var/lib/apt/lists/*
16
 
 
 
17
  WORKDIR /app
18
 
 
19
  COPY . .
20
 
21
+ RUN pip install --upgrade pip && \
22
+ pip install fastapi uvicorn playwright nest_asyncio
 
23
 
24
+ # Install Chromium browser into project directory
25
+ RUN playwright install chromium
 
 
26
 
27
+ EXPOSE 7860
 
28
 
29
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]