playwright / Dockerfile
ahmetalper's picture
Update Dockerfile
58f354f verified
FROM python:3.10
USER root
RUN apt-get update
RUN apt-get install -y libnss3
RUN apt-get install -y libnspr4
RUN apt-get install -y libdbus-1-3
RUN apt-get install -y libatk1.0-0
RUN apt-get install -y libatk-bridge2.0-0
RUN apt-get install -y libcups2
RUN apt-get install -y libdrm2
RUN apt-get install -y libxkbcommon0
RUN apt-get install -y libatspi2.0-0
RUN apt-get install -y libxcomposite1
RUN apt-get install -y libxdamage1
RUN apt-get install -y libxfixes3
RUN apt-get install -y libxrandr2
RUN apt-get install -y libgbm1
RUN apt-get install -y libasound2
RUN apt-get install -y libx11-xcb1
RUN apt-get install -y libxcursor1
RUN apt-get install -y libgtk-3-0
RUN apt-get install -y libgdk-pixbuf2.0-0
RUN rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 user
ENV HOME=/home/user
ENV PATH=/home/user/.local/bin:$PATH
USER user
WORKDIR $HOME/app
RUN pip install --no-cache-dir pillow
RUN pip install --no-cache-dir fastapi
RUN pip install --no-cache-dir uvicorn
RUN pip install --no-cache-dir requests
RUN pip install --no-cache-dir playwright
RUN pip install --no-cache-dir beautifulsoup4
RUN playwright install
COPY --chown=user . $HOME/app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]