From 50debff2da1cf92b16cdaaa224ffbd7a71bd37e9 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 9 Jun 2024 11:57:23 +1000 Subject: [PATCH 1/3] Fixes for build --- alpine/5/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alpine/5/Dockerfile b/alpine/5/Dockerfile index 113f525..b14609f 100644 --- a/alpine/5/Dockerfile +++ b/alpine/5/Dockerfile @@ -71,7 +71,7 @@ RUN addgroup --gid=$UID -S "$INVOICENINJA_USER" \ --ingroup "$INVOICENINJA_USER" \ "$INVOICENINJA_USER" -WORKDIR /var/www/app +# WORKDIR /var/www/app # Set up app ARG INVOICENINJA_VERSION From e31a2b77bcc74b90ef1cf8ab46f93cb6c2bce935 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 9 Jun 2024 12:29:25 +1000 Subject: [PATCH 2/3] Fies for downloading package --- alpine/5/Dockerfile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/alpine/5/Dockerfile b/alpine/5/Dockerfile index b14609f..b5e754d 100644 --- a/alpine/5/Dockerfile +++ b/alpine/5/Dockerfile @@ -7,9 +7,15 @@ FROM --platform=$BUILDPLATFORM node:lts-alpine as nodebuild # Download Invoice Ninja ARG INVOICENINJA_VERSION -ADD https://github.com/invoiceninja/invoiceninja/releases/download/v$INVOICENINJA_VERSION/react-invoiceninja.tar /tmp/ninja.tar +ARG REPOSITORY=invoiceninja/invoiceninja +ARG FILENAME=react-invoiceninja.tar -RUN set -eux; apk add curl unzip +RUN set -eux; apk add curl unzip grep + +# Fetch the latest release information +RUN release_info=$(curl -s "https://api.github.com/repos/${REPOSITORY}/releases/latest") && \ + download_url=$(echo "$release_info" | grep -o '"browser_download_url": "[^"]*'${FILENAME}'"' | cut -d '"' -f 4) && \ + curl -LJO "$download_url" -o "/tmp/${FILENAME}" # Extract Invoice Ninja RUN mkdir -p /var/www/app \ @@ -34,15 +40,13 @@ RUN mv /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ # Install chromium -# `ttf-dejavu` is Chinese supported fonts RUN set -eux; \ apk add --no-cache \ font-isas-misc \ supervisor \ mysql-client \ chromium \ - ttf-freefont \ - ttf-dejavu + ttf-freefont RUN install-php-extensions \ bcmath \ @@ -71,7 +75,7 @@ RUN addgroup --gid=$UID -S "$INVOICENINJA_USER" \ --ingroup "$INVOICENINJA_USER" \ "$INVOICENINJA_USER" -# WORKDIR /var/www/app +WORKDIR /var/www/app # Set up app ARG INVOICENINJA_VERSION From 738546d7b199d55005fbe5dccb0dcdb798a78545 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 9 Jun 2024 12:30:02 +1000 Subject: [PATCH 3/3] Add back fonts --- alpine/5/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/alpine/5/Dockerfile b/alpine/5/Dockerfile index b5e754d..76f551e 100644 --- a/alpine/5/Dockerfile +++ b/alpine/5/Dockerfile @@ -46,7 +46,8 @@ RUN set -eux; \ supervisor \ mysql-client \ chromium \ - ttf-freefont + ttf-freefont \ + ttf-dejavu RUN install-php-extensions \ bcmath \