File size: 562 Bytes
1c8c5fb
 
7f46342
 
 
551baf1
8eb7bd2
551baf1
7f46342
1218470
7f46342
 
1c8c5fb
8eb7bd2
 
 
7f46342
 
 
d0c6c68
 
1c8c5fb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM python:3.9-slim

# Set environment variables so Playwright works in a limited environment
ENV PLAYWRIGHT_BROWSERS_PATH=/app/pw-browsers
ENV HOME=/app

WORKDIR /app

RUN apt-get update && apt-get install -y wget gnupg && rm -rf /var/lib/apt/lists/*

RUN pip install --no-cache-dir fastapi uvicorn playwright-stealth
# Install browser in the local app folder
RUN playwright install --with-deps chromium

COPY . .

# Give full permissions to the app folder
RUN chmod -R 777 /app

EXPOSE 7860

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]