From 7cc2051528ec8596473f1104e3ffc24b427041ee Mon Sep 17 00:00:00 2001 From: Crovaxon Date: Sat, 3 May 2025 18:20:48 +0200 Subject: [PATCH] V13 main.js path compatibility + docker image enhancements. Preparing environment for building different Foundry dockers using a build argument to choose which node base image is being applied. Not strictly required right now, but might be useful in the future. --- .gitea/workflows/build-docker-image-and-push.yaml | 13 +++++++++++-- Dockerfile | 3 ++- entrypoint.sh | 10 +++++++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/build-docker-image-and-push.yaml b/.gitea/workflows/build-docker-image-and-push.yaml index b3032f9..f5349e4 100644 --- a/.gitea/workflows/build-docker-image-and-push.yaml +++ b/.gitea/workflows/build-docker-image-and-push.yaml @@ -26,9 +26,18 @@ jobs: username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_PASS }} - - name: Build and push + name: Build and push v12 compatible build uses: docker/build-push-action@v5 with: context: . push: true - tags: gitea.crovaxon.de/crovaxon/foundryvtt-docker \ No newline at end of file + tags: gitea.crovaxon.de/crovaxon/foundryvtt-docker:v12 + build-args: NODE_IMAGE_VERSION=20-alpine + - + name: Build and push v12 compatible build + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: gitea.crovaxon.de/crovaxon/foundryvtt-docker:v13,gitea.crovaxon.de/crovaxon/foundryvtt-docker:latest + build-args: NODE_IMAGE_VERSION=22-alpine \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 4f2dbe8..c3ed9ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM node:20-alpine +ARG NODE_IMAGE_VERSION=20-alpine +FROM node:${NODE_IMAGE_VERSION} LABEL maintainer="crovaxon" WORKDIR /app diff --git a/entrypoint.sh b/entrypoint.sh index d29c042..06de0a8 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -6,5 +6,13 @@ umask ${UMASK} # set permissions on application folder chown -R ${PUID}:${PGID} /foundry +# set default main.js path as used in v12 and earlier +FOUNDRY_MAIN_PATH=/foundry/resources/app/main.js + +# check for newer path used in v13 and newer +if [ ! -f /foundry/main.js ]; then + FOUNDRY_MAIN_PATH=/foundry/main.js +fi + # run Foundry with the environmentally set user and group id -exec su-exec ${PUID}:${PGID} node /foundry/resources/app/main.js --dataPath=/foundrydata \ No newline at end of file +exec su-exec ${PUID}:${PGID} node $FOUNDRY_MAIN_PATH --dataPath=/foundrydata \ No newline at end of file