From d33678b31f33b332fe2cadb2ea1d05c8bf7ca01b Mon Sep 17 00:00:00 2001 From: Bob Olde Hampsink Date: Wed, 11 Dec 2024 10:12:03 +0100 Subject: [PATCH 1/4] Validate engines --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index e101c1b..9f9dc86 100644 --- a/Dockerfile +++ b/Dockerfile @@ -141,6 +141,7 @@ ONBUILD RUN composer install --prefer-dist --no-scripts --no-progress --no-inter # run yarn install ONBUILD COPY *package*.json *yarn.lock .yarn* *.npmrc Dockerfile /app/user/ +ONBUILD RUN $ yarn plugin import https://raw.githubusercontent.com/devoto13/yarn-plugin-engines/main/bundles/%40yarnpkg/plugin-engines.js ONBUILD RUN [ -f yarn.lock ] && yarn install --mode=skip-build --network-timeout 1000000 || true # rest of app From 49e6b0f4146ca9d746c10d82a22b3edda71be1a5 Mon Sep 17 00:00:00 2001 From: Bob Olde Hampsink Date: Wed, 11 Dec 2024 10:22:48 +0100 Subject: [PATCH 2/4] Remove dollar sign --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9f9dc86..386b5ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -141,7 +141,7 @@ ONBUILD RUN composer install --prefer-dist --no-scripts --no-progress --no-inter # run yarn install ONBUILD COPY *package*.json *yarn.lock .yarn* *.npmrc Dockerfile /app/user/ -ONBUILD RUN $ yarn plugin import https://raw.githubusercontent.com/devoto13/yarn-plugin-engines/main/bundles/%40yarnpkg/plugin-engines.js +ONBUILD RUN yarn plugin import https://raw.githubusercontent.com/devoto13/yarn-plugin-engines/main/bundles/%40yarnpkg/plugin-engines.js ONBUILD RUN [ -f yarn.lock ] && yarn install --mode=skip-build --network-timeout 1000000 || true # rest of app From 27a2854fa741b5952891851cdb30884d3bec62e3 Mon Sep 17 00:00:00 2001 From: Bob Olde Hampsink Date: Wed, 11 Dec 2024 10:42:31 +0100 Subject: [PATCH 3/4] Fix yarn install not failing --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 386b5ad..e1bf143 100644 --- a/Dockerfile +++ b/Dockerfile @@ -142,7 +142,7 @@ ONBUILD RUN composer install --prefer-dist --no-scripts --no-progress --no-inter # run yarn install ONBUILD COPY *package*.json *yarn.lock .yarn* *.npmrc Dockerfile /app/user/ ONBUILD RUN yarn plugin import https://raw.githubusercontent.com/devoto13/yarn-plugin-engines/main/bundles/%40yarnpkg/plugin-engines.js -ONBUILD RUN [ -f yarn.lock ] && yarn install --mode=skip-build --network-timeout 1000000 || true +ONBUILD RUN if [ -f yarn.lock ]; then yarn install --mode=skip-build --network-timeout 1000000; fi # rest of app ONBUILD COPY . /app/user/ @@ -153,4 +153,4 @@ ONBUILD RUN composer dump-autoload # run yarn hooks ENV CPPFLAGS="-DPNG_ARM_NEON_OPT=0" -ONBUILD RUN [ -f yarn.lock ] && yarn rebuild || true +ONBUILD RUN if [ -f yarn.lock ]; then yarn rebuild; fi From 37197521b4a94eb7763e43bcdc7ec3cf8d4082c2 Mon Sep 17 00:00:00 2001 From: Bob Olde Hampsink Date: Wed, 11 Dec 2024 10:51:43 +0100 Subject: [PATCH 4/4] Only import yarn plugin when lockfile is present --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e1bf143..92f98db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -141,7 +141,7 @@ ONBUILD RUN composer install --prefer-dist --no-scripts --no-progress --no-inter # run yarn install ONBUILD COPY *package*.json *yarn.lock .yarn* *.npmrc Dockerfile /app/user/ -ONBUILD RUN yarn plugin import https://raw.githubusercontent.com/devoto13/yarn-plugin-engines/main/bundles/%40yarnpkg/plugin-engines.js +ONBUILD RUN if [ -f yarn.lock ]; then yarn plugin import https://raw.githubusercontent.com/devoto13/yarn-plugin-engines/main/bundles/%40yarnpkg/plugin-engines.js; fi ONBUILD RUN if [ -f yarn.lock ]; then yarn install --mode=skip-build --network-timeout 1000000; fi # rest of app