diff --git a/Dockerfile b/Dockerfile index fcfce76f..b136a50b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,33 +49,6 @@ 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 \ @@ -83,10 +56,12 @@ ENV POETRY_NO_INTERACTION=1 \ 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} . .