Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 6 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,44 +49,19 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
USER root
WORKDIR ${APP_DIR}

# Install system dependencies needed for Playwright
RUN apt-get update && apt-get install -y \
fonts-liberation \
libasound2 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libatspi2.0-0 \
libcups2 \
libdbus-1-3 \
libdrm2 \
libexpat1 \
libgbm1 \
libglib2.0-0 \
libgtk-3-0 \
libnspr4 \
libnss3 \
libx11-6 \
libxcomposite1 \
libxdamage1 \
libxext6 \
libxfixes3 \
libxrandr2 \
libxss1 \
libxtst6 \
xdg-utils \
&& rm -rf /var/lib/apt/lists/*

ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache \
PLAYWRIGHT_BROWSERS_PATH=${APP_DIR}/browsers

COPY pyproject.toml poetry.lock ./
RUN pip install poetry
RUN poetry install --no-root && rm -rf $POETRY_CACHE_DIR
RUN poetry run playwright install --with-deps chromium
RUN chown -R ${USER}:${USER} ${APP_DIR}

RUN pip install --no-cache-dir poetry \
&& poetry install --no-root && rm -rf $POETRY_CACHE_DIR \
&& poetry run playwright install --with-deps chromium \
&& chown -R ${USER}:${USER} ${APP_DIR} \
&& rm -rf /root/.cache/pip /tmp/*

USER ${USER}
COPY --chown=${USER}:${USER} . .
Expand Down
Loading