Skip to content

Commit

Permalink
Add Arm support
Browse files Browse the repository at this point in the history
  • Loading branch information
Loki-101 committed Nov 2, 2024
1 parent 1e8fac1 commit 8247a03
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
8 changes: 8 additions & 0 deletions .helpers/listen.sh
Original file line number Diff line number Diff line change
@@ -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
35 changes: 9 additions & 26 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 \
Expand All @@ -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

0 comments on commit 8247a03

Please sign in to comment.