Skip to content

Commit

Permalink
✨ Add pageres-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
llaumgui committed Sep 20, 2024
1 parent d708d14 commit ad81b5f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions 8.3-nextcloud/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ LABEL org.opencontainers.image.authors="[email protected]"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.version="8.3"

# Need by pageres
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
ENV CHROMIUM_PATH /usr/bin/chromium

# Fix hadolint #DL4006 (https://github.com/hadolint/hadolint/wiki/DL4006)
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand Down Expand Up @@ -54,6 +58,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
RUN apt-get update && apt-get install --no-install-recommends -y \
bzip2 \
curl \
chromium \
ffmpeg \
git \
gnupg \
Expand Down Expand Up @@ -165,6 +170,7 @@ RUN fetchDeps=" \
\
\
# ------------------------------------------------------------------ Big cleanup \
npm install -g pageres-cli && \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false ${fetchDeps}; \
apt-get clean && \
rm -rf /var/lib/apt/lists/* \
Expand All @@ -185,6 +191,11 @@ RUN sed -i 's#^;pm.status_path = .*#pm.status_path = /status#g' /usr/local/etc/p
# My configuration.
COPY php.d /usr/local/etc/php/conf.d
COPY etc /usr/local/etc/php

# Patch
COPY patch /tmp
RUN cd /usr/local/lib/node_modules/pageres-cli && patch -p0 < /tmp/pageres.patch && rm -f /tmp/pageres.patch

# Remove access log
RUN sed -i 's#^access.log = /proc/self/fd/2#access.log = /dev/null#g' /usr/local/etc/php-fpm.d/docker.conf

Expand Down
13 changes: 13 additions & 0 deletions 8.3-nextcloud/patch/pageres.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- cli.js 2024-09-20 11:47:51.746178276 +0200
+++ cli-new.js 2024-09-20 11:48:37.388920896 +0200
@@ -95,6 +95,11 @@
async function generate(arguments_, options) {
const pageres = new Pageres({
incrementalName: !options.overwrite,
+ launchOptions: {
+ executablePath: process.env.CHROMIUM_PATH,
+ args: ['--no-sandbox'],
+ headless: 'new',
+ }
})
.destination(process.cwd());

0 comments on commit ad81b5f

Please sign in to comment.