|
FROM python:3.10-slim |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
wget \ |
|
gnupg \ |
|
ca-certificates \ |
|
fonts-liberation \ |
|
libasound2 \ |
|
libasound2-dev \ |
|
libatk-bridge2.0-0 \ |
|
libatk1.0-0 \ |
|
libc6 \ |
|
libcairo2 \ |
|
libcups2 \ |
|
libdbus-1-3 \ |
|
libexpat1 \ |
|
libfontconfig1 \ |
|
libgcc-s1 \ |
|
libgdk-pixbuf2.0-0 \ |
|
libglib2.0-0 \ |
|
libgtk-3-0 \ |
|
libnspr4 \ |
|
libnss3 \ |
|
libnss3-dev \ |
|
libpango-1.0-0 \ |
|
libpangocairo-1.0-0 \ |
|
libstdc++6 \ |
|
libx11-6 \ |
|
libx11-xcb1 \ |
|
libxcb1 \ |
|
libxcomposite1 \ |
|
libxcursor1 \ |
|
libxdamage1 \ |
|
libxext6 \ |
|
libxfixes3 \ |
|
libxi6 \ |
|
libxrandr2 \ |
|
libxrender1 \ |
|
libxss1 \ |
|
libxtst6 \ |
|
lsb-release \ |
|
xdg-utils \ |
|
|
|
libgstreamer1.0-0 \ |
|
libgstreamer-plugins-base1.0-0 \ |
|
|
|
libatomic1 \ |
|
libxslt1.1 \ |
|
libvpx7 \ |
|
libevent-2.1-7 \ |
|
libopus0 \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
|
WORKDIR /code |
|
|
|
|
|
RUN pip install --upgrade pip |
|
COPY requirements.txt . |
|
RUN pip install -r requirements.txt |
|
|
|
|
|
RUN playwright install --with-deps |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
USER user |
|
ENV PATH="/home/user/.local/bin:$PATH" |
|
|
|
|
|
RUN playwright install |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
COPY --chown=user:user . /code |
|
CMD ["sh", "-c", "python init_playwright.py && python app.py"] |
|
|