From 4364a8b4b72685bf82dadc81420a8af9e6be2b55 Mon Sep 17 00:00:00 2001 From: TheSpad Date: Fri, 8 Mar 2024 18:52:07 +0000 Subject: [PATCH 1/2] Build playwright from source, add libjpeg --- Dockerfile | 9 +++++++++ Dockerfile.aarch64 | 9 +++++++++ readme-vars.yml | 1 + 3 files changed, 19 insertions(+) diff --git a/Dockerfile b/Dockerfile index 456d463..349b46c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,8 @@ RUN \ apk add --update --no-cache --virtual=build-dependencies \ build-base \ cargo \ + git \ + jpeg-dev \ libc-dev \ libffi-dev \ libxslt-dev \ @@ -21,6 +23,8 @@ RUN \ python3-dev \ zlib-dev && \ apk add --update --no-cache \ + chromium-chromedriver \ + libjpeg \ libxslt \ poppler-utils \ python3 && \ @@ -42,6 +46,11 @@ RUN \ pip \ wheel && \ pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.19/ -r /app/changedetection/requirements.txt && \ + PLAYWRIGHT_RELEASE=$(curl -sX GET "https://api.github.com/repos/microsoft/playwright-python/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + git clone --depth 1 --branch "${PLAYWRIGHT_RELEASE}" https://github.com/microsoft/playwright-python /tmp/playwright-python && \ + cd /tmp/playwright-python && \ + pip install -U --no-cache-dir . && \ apk del --purge \ build-dependencies && \ rm -rf \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 9c5874a..427ae8e 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -14,6 +14,8 @@ RUN \ apk add --update --no-cache --virtual=build-dependencies \ build-base \ cargo \ + git \ + jpeg-dev \ libc-dev \ libffi-dev \ libxslt-dev \ @@ -21,6 +23,8 @@ RUN \ python3-dev \ zlib-dev && \ apk add --update --no-cache \ + chromium-chromedriver \ + libjpeg \ libxslt \ poppler-utils \ python3 && \ @@ -42,6 +46,11 @@ RUN \ pip \ wheel && \ pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.19/ -r /app/changedetection/requirements.txt && \ + PLAYWRIGHT_RELEASE=$(curl -sX GET "https://api.github.com/repos/microsoft/playwright-python/releases/latest" \ + | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + git clone --depth 1 --branch "${PLAYWRIGHT_RELEASE}" https://github.com/microsoft/playwright-python /tmp/playwright-python && \ + cd /tmp/playwright-python && \ + pip install -U --no-cache-dir . && \ apk del --purge \ build-dependencies && \ rm -rf \ diff --git a/readme-vars.yml b/readme-vars.yml index a3e87ef..29454ee 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -62,6 +62,7 @@ app_setup_block: | # changelog changelogs: + - { date: "08.03.24:", desc: "Build Playwright from source, add libjpeg."} - { date: "23.12.23:", desc: "Rebase to Alpine 3.19."} - { date: "10.08.23:", desc: "Add poppler-utils for pdf conversion tools." } - { date: "11.06.23:", desc: "Rebase to Alpine 3.18, deprecate armhf." } From c7cdbf785016c9ec47d5a87eb35caabff6b1e4a4 Mon Sep 17 00:00:00 2001 From: TheSpad Date: Fri, 8 Mar 2024 18:59:27 +0000 Subject: [PATCH 2/2] Update playwright/chromedriver notes, remove chromedriver --- Dockerfile | 1 - Dockerfile.aarch64 | 1 - readme-vars.yml | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 349b46c..9101148 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,6 @@ RUN \ python3-dev \ zlib-dev && \ apk add --update --no-cache \ - chromium-chromedriver \ libjpeg \ libxslt \ poppler-utils \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 427ae8e..b51bf48 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -23,7 +23,6 @@ RUN \ python3-dev \ zlib-dev && \ apk add --update --no-cache \ - chromium-chromedriver \ libjpeg \ libxslt \ poppler-utils \ diff --git a/readme-vars.yml b/readme-vars.yml index 29454ee..1273bc2 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -56,7 +56,7 @@ app_setup_block_enabled: true app_setup_block: | Webui is accessible at http://SERVERIP:PORT - Please note that this image does not contain the [Playwright content fetcher](https://github.com/dgtlmoon/changedetection.io/wiki/Playwright-content-fetcher#docker-compose-based) due to a lack of support for muslc-based systems. If you require this feature please use [Selenium](https://github.com/linuxserver/docker-changedetection.io/issues/3#issuecomment-1250251715) or the [official container](https://github.com/dgtlmoon/changedetection.io#docker) + Please note that as of version 0.45.15 this image contains the [Playwright content fetcher](https://github.com/dgtlmoon/changedetection.io/wiki/Playwright-content-fetcher#docker-compose-based). For more info read [the wiki](https://github.com/dgtlmoon/changedetection.io/wiki).