From 50101a8cac33a68741fd3ffe488e4acb87f4bb57 Mon Sep 17 00:00:00 2001 From: Chris Weaver <25087905+Weves@users.noreply.github.com> Date: Mon, 4 Sep 2023 10:42:49 -0700 Subject: [PATCH] Use newest version of LTS node for playwright (#393) --- backend/Dockerfile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/backend/Dockerfile b/backend/Dockerfile index 8a15781a9..9f3f84a48 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -15,6 +15,21 @@ RUN pip uninstall -y py RUN playwright install chromium RUN playwright install-deps chromium +# install nodejs and replace nodejs packaged with playwright (18.17.0) with the one installed below +# based on the instructions found here: +# https://nodejs.org/en/download/package-manager#debian-and-ubuntu-based-linux-distributions +# this is temporarily needed until playwright updates their packaged node version to +# 18.17.1+ (or 20.5.1+) +RUN apt-get update +RUN apt-get install -y ca-certificates curl gnupg +RUN mkdir -p /etc/apt/keyrings +RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list +RUN apt-get update +RUN apt-get install nodejs -y +# replace nodejs packaged with playwright (18.17.0) with the one installed above +RUN cp /usr/bin/node /usr/local/lib/python3.11/site-packages/playwright/driver/node + # Cleanup for CVEs and size reduction RUN apt-get remove -y linux-libc-dev \ && apt-get autoremove -y \