diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index ab990a660e..09154dd038 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -1366,12 +1366,16 @@ RUN if [ ${INSTALL_DNSUTILS} = true ]; then \ USER root ARG INSTALL_PUPPETEER=false +ARG NODE_MAJOR=20 RUN if [ ${INSTALL_PUPPETEER} = true ]; then \ - curl -sL https://deb.nodesource.com/setup_current.x | bash \ - && apt-get install -y nodejs gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm-dev libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 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 ca-certificates fonts-liberation libnss3 xdg-utils wget \ - && npm install --global --unsafe-perm puppeteer@v18 \ - && chmod -R o+rx /usr/lib/node_modules/puppeteer/node_modules/puppeteer-core/.local-chromium \ + apt-get update && apt-get install -y ca-certificates curl gnupg \ + && mkdir -p /etc/apt/keyrings \ + && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ + && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \ + && apt-get update && apt-get install -y nodejs \ + && npm install --global puppeteer \ + && chmod -R o+rx ~/.cache/puppeteer \ ;fi diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 6c94cfa86e..1826150f09 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -1869,17 +1869,14 @@ RUN if [ ${INSTALL_JDK} = true ]; then \ ########################################################################### # PUPPETEER: ########################################################################### -USER root +USER laradock ARG INSTALL_PUPPETEER=false +# Assumes Node is installed RUN if [ ${INSTALL_PUPPETEER} = true ]; then \ - apt-get update \ - && apt-get install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 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 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget \ - && npm install --global --unsafe-perm puppeteer@v18 \ - && find $NVM_DIR -type f -name node -exec ln -s {} /usr/local/bin/node \; \ - && NODE_MODS_DIR="$NVM_DIR/versions/node/$(node -v)/lib/node_modules" \ - && chmod -R o+rx $NODE_MODS_DIR/puppeteer/node_modules/puppeteer-core/.local-chromium \ + npm install --global puppeteer \ + && chmod -R o+rx ~/.cache/puppeteer \ ;fi #