playwright_server / Dockerfile
vaibhav212303
Fix: move to fetcher.get() pattern to resolve attribute error
81145ab
Raw
History Blame Contribute Delete
871 Bytes
FROM python:3.12-slim
RUN apt-get update && apt-get install -y \
wget \
gnupg \
libnss3 \
libnspr4 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libcups2 \
libdrm2 \
libxkbcommon0 \
libxcomposite1 \
libxdamage1 \
libxext6 \
libxfixes3 \
libxrandr2 \
libgbm1 \
libpango-1.0-0 \
libcairo2 \
libasound2 \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR /app
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Install Chromium and FFMPEG for video
RUN playwright install chromium
RUN playwright install ffmpeg
COPY --chown=user . .
EXPOSE 7860
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]