diff --git a/Dockerfile b/Dockerfile index dea54a9..ed9edbe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1 + FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.17 # set version label @@ -13,9 +15,7 @@ ENV BUDGE_DATABASE=/config/budge.db \ RUN \ echo "**** install build packages ****" && \ apk add --no-cache --virtual=build-dependencies \ - g++ \ - gcc \ - make \ + build-base \ musl-dev \ python3 && \ echo "**** install runtime packages ****" && \ @@ -61,3 +61,7 @@ RUN \ # add local files COPY root/ / + +# ports and volumes +EXPOSE 80 443 +VOLUME /config diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index d8c677c..4b45274 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1 + FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.17 # set version label @@ -13,9 +15,7 @@ ENV BUDGE_DATABASE=/config/budge.db \ RUN \ echo "**** install build packages ****" && \ apk add --no-cache --virtual=build-dependencies \ - g++ \ - gcc \ - make \ + build-base \ musl-dev \ python3 && \ echo "**** install runtime packages ****" && \ @@ -31,7 +31,7 @@ RUN \ fi && \ curl -o \ /tmp/budge.tar.gz -L \ - "https://github.com/linuxserver/BudgE/archive/${BUDGE_RELEASE}.tar.gz" && \ + "https://github.com/linuxserver/budge/archive/${BUDGE_RELEASE}.tar.gz" && \ tar xf \ /tmp/budge.tar.gz -C \ /app/www/public/ --strip-components=1 && \ @@ -61,3 +61,7 @@ RUN \ # add local files COPY root/ / + +# ports and volumes +EXPOSE 80 443 +VOLUME /config diff --git a/Dockerfile.armhf b/Dockerfile.armhf index e07cd64..58d2771 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -1,3 +1,5 @@ +# syntax=docker/dockerfile:1 + FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm32v7-3.17 # set version label @@ -13,9 +15,7 @@ ENV BUDGE_DATABASE=/config/budge.db \ RUN \ echo "**** install build packages ****" && \ apk add --no-cache --virtual=build-dependencies \ - g++ \ - gcc \ - make \ + build-base \ musl-dev \ python3 && \ echo "**** install runtime packages ****" && \ @@ -31,7 +31,7 @@ RUN \ fi && \ curl -o \ /tmp/budge.tar.gz -L \ - "https://github.com/linuxserver/BudgE/archive/${BUDGE_RELEASE}.tar.gz" && \ + "https://github.com/linuxserver/budge/archive/${BUDGE_RELEASE}.tar.gz" && \ tar xf \ /tmp/budge.tar.gz -C \ /app/www/public/ --strip-components=1 && \ @@ -61,3 +61,7 @@ RUN \ # add local files COPY root/ / + +# ports and volumes +EXPOSE 80 443 +VOLUME /config diff --git a/root/etc/s6-overlay/s6-rc.d/svc-budge/run b/root/etc/s6-overlay/s6-rc.d/svc-budge/run index 0fa103c..dc03cf0 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-budge/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-budge/run @@ -1,7 +1,8 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash shopt -s globstar exec \ s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 5000" \ - cd /app/www/public/backend/build s6-setuidgid abc /usr/bin/npm run start --logs-dir /config/log/npm + cd /app/www/public/backend/build s6-setuidgid abc /usr/bin/npm run start --logs-dir /config/log/npm diff --git a/root/init-hook b/root/init-hook index c4bf1e5..5edbc8d 100755 --- a/root/init-hook +++ b/root/init-hook @@ -1,4 +1,5 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash rm -rf /etc/s6-overlay/s6-rc.d/svc-php-fpm rm -rf /etc/s6-overlay/s6-rc.d/user/contents.d/svc-php-fpm diff --git a/root/migrations/02-default-location b/root/migrations/02-default-location index 69ee5a9..5d8d1ba 100644 --- a/root/migrations/02-default-location +++ b/root/migrations/02-default-location @@ -1,10 +1,11 @@ #!/usr/bin/with-contenv bash +# shellcheck shell=bash DEFAULT_CONF="/config/nginx/site-confs/default.conf" OLD_ROOT="root /app/budge/frontend/build;" NEW_ROOT="root /app/www/public/frontend/build;" -if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}" 2>/dev/null;then +if grep -q "${OLD_ROOT}" "${DEFAULT_CONF}" 2>/dev/null; then echo "updating root in ${DEFAULT_CONF}" sed -i "s|${OLD_ROOT}|${NEW_ROOT}|" "${DEFAULT_CONF}" fi