From 8247a034651c4ca20e5fdd865d9c14e3b96e633f Mon Sep 17 00:00:00 2001 From: Loki <59907407+Loki-101@users.noreply.github.com> Date: Fri, 1 Nov 2024 19:24:03 -0700 Subject: [PATCH] Add Arm support --- .helpers/listen.sh | 8 ++++++++ Dockerfile | 35 +++++++++-------------------------- 2 files changed, 17 insertions(+), 26 deletions(-) create mode 100644 .helpers/listen.sh diff --git a/.helpers/listen.sh b/.helpers/listen.sh new file mode 100644 index 0000000..639afad --- /dev/null +++ b/.helpers/listen.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# Initial sync on startup to ensure /app is up to date with /blueprint_extensions +rsync -av --exclude=".blueprint" --include="*.blueprint*" --exclude="*" --delete /blueprint_extensions/ /app/ + +# Continuously watch for file changes in /blueprint_extensions +while inotifywait -r -e create,delete,modify,move --include=".*\\.blueprint$" /blueprint_extensions; do + rsync -av --exclude=".blueprint" --include="*.blueprint*" --exclude="*" --delete /blueprint_extensions/ /app/ +done \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 0ddad70..a0a9ab2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ ARG VERSION_TAG -FROM ghcr.io/pterodactyl/panel:${VERSION_TAG} +FROM --platform=$TARGETOS/$TARGETARCH ghcr.io/pterodactyl/panel:${VERSION_TAG} # Set the Working Directory WORKDIR /app @@ -25,22 +25,10 @@ RUN apk update && apk add --no-cache \ rsync \ inotify-tools -# Environment for NVM and Node.js installation -ENV NVM_DIR="/root/.nvm" -ENV NODE_BASE_VERSION="20" -# Set unofficial Node.js builds mirror for musl -ENV NVM_NODEJS_ORG_MIRROR="https://unofficial-builds.nodejs.org/download/release" - -# Install NVM and configure the environment -RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \ - && [ -s $NVM_DIR/nvm.sh ] && \. $NVM_DIR/nvm.sh \ - && echo "nvm_get_arch() { nvm_echo 'x64-musl'; }" >> $NVM_DIR/nvm.sh \ - && source $NVM_DIR/nvm.sh \ - && latest_version=$(nvm ls-remote | grep 'Latest LTS' | awk '{print $1}' | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' | sort -t. -k1,1nr -k2,2nr -k3,3nr | head -n1) \ - && nvm install $latest_version \ - && npm config set prefix /usr \ - && npm install -g yarn \ - && yarn +# Install yarn and Pterodactyl dependencies, as well as update browserlist +RUN npm install -g yarn && \ + yarn && \ + npx update-browserslist-db@latest # Download and unzip the latest Blueprint release RUN wget $(curl -s https://api.github.com/repos/BlueprintFramework/framework/releases/latest | grep 'browser_download_url' | cut -d '"' -f 4) -O blueprint.zip \ @@ -64,14 +52,9 @@ RUN chmod +x blueprint.sh \ # Create directory for blueprint extensions RUN mkdir -p /blueprint_extensions /app -# Create the listen.sh script to monitor and sync blueprint files -RUN echo -e '#!/bin/sh\n\ -# Initial sync on startup to ensure /app is up to date with /blueprint_extensions\n\ -rsync -av --exclude=".blueprint" --include="*.blueprint*" --exclude="*" --delete /blueprint_extensions/ /app/\n\ -# Continuously watch for file changes in /blueprint_extensions\n\ -while inotifywait -r -e create,delete,modify,move --include=".*\\.blueprint$" /blueprint_extensions; do\n\ - rsync -av --exclude=".blueprint" --include="*.blueprint*" --exclude="*" --delete /blueprint_extensions/ /app/\n\ -done' > /listen.sh && chmod +x /listen.sh +# Copy listen.sh from .helpers directory +COPY .helpers/listen.sh /listen.sh +RUN chmod +x /listen.sh # Set CMD to run the listen script in the background and start supervisord -CMD /listen.sh & exec supervisord -n -c /etc/supervisord.conf +CMD /listen.sh & exec supervisord -n -c /etc/supervisord.conf \ No newline at end of file