From a07cd2141b0e33035cfd238d573eded65b0abc84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Mon, 26 Oct 2026 07:24:07 +0000 Subject: [PATCH 1/3] Upgrade base images to PHP 8.2.35 and fix Docker Hub publishing Akaunting 3.2 requires PHP ^8.2, so images built on PHP 8.1 could no longer install or run the latest release. As a result, Docker Hub tags, including `latest`, have been stuck on 3.1.21 (akaunting/akaunting#3402). PHP 8.2.35 also fixes the critical unauthenticated RCE vulnerabilities CVE-2026-109618 and CVE-2026-109619 ("PHP2Shell"). PHP 8.1 has no official fix for them. Images: - Apache images (Dockerfile, v.Dockerfile): php:8.1-apache -> php:8.2.35-apache - FPM image: php:8.1-fpm -> php:8.2.35-fpm - Alpine images: php:8.1-fpm-alpine3.15 -> php:8.2.35-fpm-alpine3.24, and the apk repositories now point to Alpine v3.24 Workflow: - Replace the deprecated `::set-output` command with $GITHUB_OUTPUT - Add a workflow_dispatch trigger for manual rebuilds - Bump actions/checkout to v4, docker/setup-qemu-action and docker/setup-buildx-action to v3, docker/login-action to v3, and docker/build-push-action to v6 --- .github/workflows/docker-hub.yml | 33 ++++++++++--------- Dockerfile | 2 +- ...lpine-nginx-composer-supervisor.Dockerfile | 6 ++-- fpm-alpine-nginx-composer.Dockerfile | 6 ++-- fpm-alpine-nginx.Dockerfile | 6 ++-- fpm-alpine.Dockerfile | 6 ++-- fpm.Dockerfile | 2 +- v.Dockerfile | 2 +- 8 files changed, 32 insertions(+), 31 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index 5876474..c1b781e 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -7,6 +7,7 @@ on: branches: - '**' pull_request: + workflow_dispatch: jobs: docker: @@ -31,17 +32,17 @@ jobs: file: fpm-alpine-nginx-composer-supervisor.Dockerfile steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Define tag name id: tag-name run: | if [ "${GITHUB_REF}" == "refs/heads/master" -a "${GITHUB_EVENT_NAME}" != "pull_request" ]; then curl -s https://api.github.com/repos/akaunting/akaunting/releases/latest \ | jq -r .tag_name | sed \ - -e 's/^/::set-output name=tag::/' + -e 's/^/tag=/' >> "$GITHUB_OUTPUT" else - echo -n "::set-output name=tag::" - echo "$GITHUB_REF" | cut -d/ -f3- | tr '/' '_' + echo -n "tag=" >> "$GITHUB_OUTPUT" + echo "$GITHUB_REF" | cut -d/ -f3- | tr '/' '_' >> "$GITHUB_OUTPUT" fi - name: Define images tags id: image-tags @@ -51,38 +52,38 @@ jobs: echo ${{ steps.tag-name.outputs.tag }} | sed \ -e 's/\(\(\([0-9]\+\)\.[0-9]\+\)\.[0-9]\+\)/\1,\2,\3,/' \ -e 's/\([^,]\+\),/akaunting\/akaunting:\1,/g' \ - -e 's/^/::set-output name=tags::/' \ - -e 's/$/akaunting\/akaunting:latest/' + -e 's/^/tags=/' \ + -e 's/$/akaunting\/akaunting:latest/' >> "$GITHUB_OUTPUT" else echo ${{ steps.tag-name.outputs.tag }} | sed \ -e 's/\(\(\([0-9]\+\)\.[0-9]\+\)\.[0-9]\+\)/\1-${{ matrix.image }},\2-${{ matrix.image }},\3-${{ matrix.image }},/' \ -e 's/\([^,]\+\),/akaunting\/akaunting:\1,/g' \ - -e 's/^/::set-output name=tags::/' + -e 's/^/tags=/' >> "$GITHUB_OUTPUT" fi else if [ -z ${{ matrix.image }} ]; then - echo -n "::set-output name=tags::akaunting/akaunting:" - echo "$GITHUB_REF" | cut -d/ -f3- | tr '/' '_' + echo -n "tags=akaunting/akaunting:" >> "$GITHUB_OUTPUT" + echo "$GITHUB_REF" | cut -d/ -f3- | tr '/' '_' >> "$GITHUB_OUTPUT" else - echo -n "::set-output name=tags::akaunting/akaunting:" - echo "$(echo "$GITHUB_REF" | cut -d/ -f3- | tr '/' '_')-${{ matrix.image }}" + echo -n "tags=akaunting/akaunting:" >> "$GITHUB_OUTPUT" + echo "$(echo "$GITHUB_REF" | cut -d/ -f3- | tr '/' '_')-${{ matrix.image }}" >> "$GITHUB_OUTPUT" fi fi - name: Set up QEMU if: matrix.image == '' || matrix.image == 'v' || matrix.image == 'fpm' || matrix.image == 'fpm-alpine' || matrix.image == 'fpm-alpine-nginx' - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx if: matrix.image == '' || matrix.image == 'v' || matrix.image == 'fpm' || matrix.image == 'fpm-alpine' || matrix.image == 'fpm-alpine-nginx' - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub if: github.event_name != 'pull_request' - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push images if: matrix.image == '' || matrix.image == 'v' || matrix.image == 'fpm' || matrix.image == 'fpm-alpine' || matrix.image == 'fpm-alpine-nginx' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: context: . file: ./${{ matrix.file }} @@ -91,7 +92,7 @@ jobs: tags: ${{ steps.image-tags.outputs.tags }} - name: Build and push images if: matrix.image == 'fpm-alpine-nginx-composer' || matrix.image == 'fpm-alpine-nginx-composer-supervisor' - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: context: . file: ./${{ matrix.file }} diff --git a/Dockerfile b/Dockerfile index da86e7e..7454b05 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1-apache +FROM php:8.2.35-apache ARG AKAUNTING_DOCKERFILE_VERSION=0.1 ARG SUPPORTED_LOCALES="en_US.UTF-8" diff --git a/fpm-alpine-nginx-composer-supervisor.Dockerfile b/fpm-alpine-nginx-composer-supervisor.Dockerfile index 0d6b38a..73062e4 100644 --- a/fpm-alpine-nginx-composer-supervisor.Dockerfile +++ b/fpm-alpine-nginx-composer-supervisor.Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1-fpm-alpine3.15 +FROM php:8.2.35-fpm-alpine3.24 # Arguments defined in docker-compose.yml ARG AKAUNTING_DOCKERFILE_VERSION=0.1 @@ -6,8 +6,8 @@ ARG SUPPORTED_LOCALES="en_US.UTF-8" # Add Repositories RUN rm -f /etc/apk/repositories &&\ - echo "http://dl-cdn.alpinelinux.org/alpine/v3.15/main" >> /etc/apk/repositories && \ - echo "http://dl-cdn.alpinelinux.org/alpine/v3.15/community" >> /etc/apk/repositories + echo "http://dl-cdn.alpinelinux.org/alpine/v3.24/main" >> /etc/apk/repositories && \ + echo "http://dl-cdn.alpinelinux.org/alpine/v3.24/community" >> /etc/apk/repositories # Add Dependencies RUN apk add --update --no-cache \ diff --git a/fpm-alpine-nginx-composer.Dockerfile b/fpm-alpine-nginx-composer.Dockerfile index e8462d5..87fada4 100644 --- a/fpm-alpine-nginx-composer.Dockerfile +++ b/fpm-alpine-nginx-composer.Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1-fpm-alpine3.15 +FROM php:8.2.35-fpm-alpine3.24 # Arguments defined in docker-compose.yml ARG AKAUNTING_DOCKERFILE_VERSION=0.1 @@ -6,8 +6,8 @@ ARG SUPPORTED_LOCALES="en_US.UTF-8" # Add Repositories RUN rm -f /etc/apk/repositories &&\ - echo "http://dl-cdn.alpinelinux.org/alpine/v3.15/main" >> /etc/apk/repositories && \ - echo "http://dl-cdn.alpinelinux.org/alpine/v3.15/community" >> /etc/apk/repositories + echo "http://dl-cdn.alpinelinux.org/alpine/v3.24/main" >> /etc/apk/repositories && \ + echo "http://dl-cdn.alpinelinux.org/alpine/v3.24/community" >> /etc/apk/repositories # Add Dependencies RUN apk add --update --no-cache \ diff --git a/fpm-alpine-nginx.Dockerfile b/fpm-alpine-nginx.Dockerfile index cfd5b11..f76e1cc 100644 --- a/fpm-alpine-nginx.Dockerfile +++ b/fpm-alpine-nginx.Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1-fpm-alpine3.15 +FROM php:8.2.35-fpm-alpine3.24 # Arguments defined in docker-compose.yml ARG AKAUNTING_DOCKERFILE_VERSION=0.1 @@ -6,8 +6,8 @@ ARG SUPPORTED_LOCALES="en_US.UTF-8" # Add Repositories RUN rm -f /etc/apk/repositories &&\ - echo "http://dl-cdn.alpinelinux.org/alpine/v3.15/main" >> /etc/apk/repositories && \ - echo "http://dl-cdn.alpinelinux.org/alpine/v3.15/community" >> /etc/apk/repositories + echo "http://dl-cdn.alpinelinux.org/alpine/v3.24/main" >> /etc/apk/repositories && \ + echo "http://dl-cdn.alpinelinux.org/alpine/v3.24/community" >> /etc/apk/repositories # Add Dependencies RUN apk add --update --no-cache \ diff --git a/fpm-alpine.Dockerfile b/fpm-alpine.Dockerfile index 67dd88e..c854806 100644 --- a/fpm-alpine.Dockerfile +++ b/fpm-alpine.Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1-fpm-alpine3.15 +FROM php:8.2.35-fpm-alpine3.24 # Arguments defined in docker-compose.yml ARG AKAUNTING_DOCKERFILE_VERSION=0.1 @@ -6,8 +6,8 @@ ARG SUPPORTED_LOCALES="en_US.UTF-8" # Add Repositories RUN rm -f /etc/apk/repositories &&\ - echo "http://dl-cdn.alpinelinux.org/alpine/v3.15/main" >> /etc/apk/repositories && \ - echo "http://dl-cdn.alpinelinux.org/alpine/v3.15/community" >> /etc/apk/repositories + echo "http://dl-cdn.alpinelinux.org/alpine/v3.24/main" >> /etc/apk/repositories && \ + echo "http://dl-cdn.alpinelinux.org/alpine/v3.24/community" >> /etc/apk/repositories # Add Build Dependencies RUN apk add --no-cache --virtual .build-deps \ diff --git a/fpm.Dockerfile b/fpm.Dockerfile index be59770..0a1796d 100644 --- a/fpm.Dockerfile +++ b/fpm.Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1-fpm +FROM php:8.2.35-fpm # Arguments defined in docker-compose.yml ARG AKAUNTING_DOCKERFILE_VERSION=0.1 diff --git a/v.Dockerfile b/v.Dockerfile index 1aafc4b..c977e55 100644 --- a/v.Dockerfile +++ b/v.Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1-apache +FROM php:8.2.35-apache ARG AKAUNTING_DOCKERFILE_VERSION=0.1 ARG SUPPORTED_LOCALES="en_US.UTF-8" From 4610b553038cba3a47143bf27c357d07ca7d7816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Mon, 26 Oct 2026 07:45:33 +0000 Subject: [PATCH 2/3] Use Node.js 20 in the composer images The composer images run `npm install` and `npm run prod`, which failed on Alpine 3.24 because it ships Node.js 24. Akaunting requires node >=18 <21, and node-sass does not build on Node.js 24. Copy Node.js 20 and npm from the official node:20.20.2-alpine3.23 image instead of installing them from apk. Also set `fail-fast: false` in the build matrix, so a failure in one image no longer cancels the builds of the other images. --- .github/workflows/docker-hub.yml | 1 + fpm-alpine-nginx-composer-supervisor.Dockerfile | 8 ++++++-- fpm-alpine-nginx-composer.Dockerfile | 8 ++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml index c1b781e..c4bff9e 100644 --- a/.github/workflows/docker-hub.yml +++ b/.github/workflows/docker-hub.yml @@ -13,6 +13,7 @@ jobs: docker: runs-on: ubuntu-22.04 strategy: + fail-fast: false matrix: image: ['', v, fpm, fpm-alpine, fpm-alpine-nginx, fpm-alpine-nginx-composer, fpm-alpine-nginx-composer-supervisor] include: diff --git a/fpm-alpine-nginx-composer-supervisor.Dockerfile b/fpm-alpine-nginx-composer-supervisor.Dockerfile index 73062e4..07015b0 100644 --- a/fpm-alpine-nginx-composer-supervisor.Dockerfile +++ b/fpm-alpine-nginx-composer-supervisor.Dockerfile @@ -18,11 +18,15 @@ RUN apk add --update --no-cache \ supervisor \ vim \ bash \ - nodejs \ - npm \ git \ nginx +# Add Node.js 20 (Akaunting requires node >=18 <21 and node-sass does not build on the Node.js 24 shipped by Alpine 3.24) +COPY --from=node:20.20.2-alpine3.23 /usr/local/bin/node /usr/local/bin/node +COPY --from=node:20.20.2-alpine3.23 /usr/local/lib/node_modules /usr/local/lib/node_modules +RUN ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \ + && ln -s ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx + ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ # Install PHP Extensions diff --git a/fpm-alpine-nginx-composer.Dockerfile b/fpm-alpine-nginx-composer.Dockerfile index 87fada4..a639b6d 100644 --- a/fpm-alpine-nginx-composer.Dockerfile +++ b/fpm-alpine-nginx-composer.Dockerfile @@ -17,11 +17,15 @@ RUN apk add --update --no-cache \ python3 \ nano \ bash \ - nodejs \ - npm \ git \ nginx +# Add Node.js 20 (Akaunting requires node >=18 <21 and node-sass does not build on the Node.js 24 shipped by Alpine 3.24) +COPY --from=node:20.20.2-alpine3.23 /usr/local/bin/node /usr/local/bin/node +COPY --from=node:20.20.2-alpine3.23 /usr/local/lib/node_modules /usr/local/lib/node_modules +RUN ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \ + && ln -s ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx + ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ # Install PHP Extensions From 1f9ca8e04e467567aec2e829aea0badba4017ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Mon, 26 Oct 2026 07:45:33 +0000 Subject: [PATCH 3/3] Document how to upgrade an existing installation Pulling a newer image does not upgrade Akaunting, because the application files are kept in the akaunting-data volume. Explain how to back up the database, switch to the new image, and then upgrade with `php artisan update:all`, in that order. Akaunting 3.2 requires PHP 8.2, so upgrading on a PHP 8.1 image breaks the application. --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index e291143..a85503a 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,35 @@ SESSION_DRIVER: "redis" QUEUE_CONNECTION: "redis" ``` +## Upgrading + +The application files live in the `akaunting-data` volume, so pulling a newer image updates PHP and the system packages but **not** Akaunting itself. Upgrade Akaunting from inside the running container instead. + +> Akaunting 3.2 and later require PHP 8.2. Always switch to the new image **before** upgrading Akaunting. Upgrading Akaunting on an old PHP 8.1 image leaves the application unable to start. + +1. Back up your database: + + ```shell + docker exec akaunting-db sh -c 'exec mariadb-dump -u"$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE"' > akaunting-backup.sql + ``` + +2. Pull the new image and recreate the container: + + ```shell + docker-compose pull + docker-compose up -d + ``` + +3. Upgrade Akaunting and its installed apps: + + ```shell + docker exec -u www-data akaunting php artisan update:all + ``` + + You can also do this step from **Settings > Updates** in the Akaunting web interface. + +Do not just copy the new files over the old ones and run `php artisan migrate`. Some versions also update existing data during the upgrade, and that step only runs through the updater. + ## Extra ways to explore containerized Akaunting! This repository contains extra compose and other files that allows you to run Akaunting in different setups like using FPM and NGINX and here is the most important commands that you may need: