Rewrite to not need bash

This commit is contained in:
2024-01-23 13:11:56 -06:00
parent a710a0c966
commit 3c29d6d460
6 changed files with 15 additions and 15 deletions

View File

@@ -5,7 +5,6 @@ ENV PHP_VER="php81" \
NODE_OPTIONS=--openssl-legacy-provider NODE_OPTIONS=--openssl-legacy-provider
RUN apk --no-cache add \ RUN apk --no-cache add \
bash \
curl \ curl \
nginx \ nginx \
${PHP_VER} \ ${PHP_VER} \
@@ -31,6 +30,7 @@ RUN apk --no-cache add \
${PHP_VER}-xmlwriter \ ${PHP_VER}-xmlwriter \
${PHP_VER}-zip \ ${PHP_VER}-zip \
${PHP_VER}-zlib && \ ${PHP_VER}-zlib && \
rm -rf /var/www/localhost && \
mkdir -p \ mkdir -p \
/var/www/pterodactyl \ /var/www/pterodactyl \
/run/nginx \ /run/nginx \
@@ -48,7 +48,7 @@ ADD https://github.com/pterodactyl/panel/releases/latest/download/panel.tar.gz p
# Install dependencies, perform Panel installation process # Install dependencies, perform Panel installation process
RUN apk --no-cache add yarn && \ RUN apk --no-cache add yarn && \
tar -xf panel.tar.gz && \ tar -xzvf panel.tar.gz && \
rm panel.tar.gz && \ rm panel.tar.gz && \
chmod -R 755 storage/* bootstrap/cache && \ chmod -R 755 storage/* bootstrap/cache && \
find storage -type d > .storage.tmpl && \ find storage -type d > .storage.tmpl && \
@@ -77,7 +77,7 @@ ADD https://github.com/just-containers/s6-overlay/releases/latest/download/s6-ov
ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh /usr/local/bin/wait-for-it ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh /usr/local/bin/wait-for-it
# Download common tools # Download common tools
ADD https://gitea.taco.quest/Mindfang/ProjectTools/raw/branch/main/DockerUtilities/ContainerTools /usr/bin/ContainerTools ADD https://gitea.taco.quest/Mindfang/ProjectTools/raw/branch/main/DockerUtilities/sh/ContainerTools /usr/bin/ContainerTools
# Install S6-Overlay and Wait-For-It # Install S6-Overlay and Wait-For-It
RUN chmod u+x /usr/local/bin/wait-for-it /etc/s6-overlay/scripts/initializer && \ RUN chmod u+x /usr/local/bin/wait-for-it /etc/s6-overlay/scripts/initializer && \

View File

@@ -1,3 +1,3 @@
#!/command/with-contenv bash #!/command/with-contenv sh
/usr/sbin/crond -fL /dev/null /usr/sbin/crond -fL /dev/null

View File

@@ -1,3 +1,3 @@
#!/command/with-contenv bash #!/command/with-contenv sh
/usr/sbin/nginx -g "daemon off;" /usr/sbin/nginx -g "daemon off;"

View File

@@ -1,3 +1,3 @@
#!/command/with-contenv bash #!/command/with-contenv sh
/usr/sbin/php-fpm -Fc /etc/php /usr/sbin/php-fpm -Fc /etc/php

View File

@@ -1,4 +1,4 @@
#!/command/with-contenv bash #!/command/with-contenv sh
s6-setuidgid nginx s6-setuidgid nginx
/usr/bin/php /var/www/pterodactyl/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3 /usr/bin/php /var/www/pterodactyl/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3

View File

@@ -1,14 +1,14 @@
#!/command/with-contenv bash #!/command/with-contenv sh
source ContainerTools source ContainerTools
SNAME=${BASH_SOURCE##*/} SNAME=${0##*/}
WORKDIR="/var/www/pterodactyl" WORKDIR="/var/www/pterodactyl"
#
# If DBHOST value is present, pause boot until target container is up. # If DBHOST value is present, pause boot until target container is up.
if [ -n "$DBHOST" ]; then if [ -n "$DBHOST" ]; then
log "Waiting for SQL at $DBHOST:${DBPORT:=3306}" log "Waiting for SQL at $DBHOST:${DBPORT:=3306}"
if wait-for-it $DBHOST:$DBPORT -q -t ${TESTTIME:=30}; then if wait-for-it $DBHOST:$DBPORT -q -t ${TESTTIME:=30}; then
log "SQL found, continuing" log "SQL found, continuing"
else else
log "SQL could not be reached! Exiting..." log "SQL could not be reached! Exiting..."
exit 1 exit 1
@@ -18,8 +18,8 @@ fi
# If REDISHOST value is present, pause boot until target container is up. # If REDISHOST value is present, pause boot until target container is up.
if [ -n "$REDISHOST" ]; then if [ -n "$REDISHOST" ]; then
log "Waiting for Redis at $REDISHOST:${REDISPORT:=6379}" log "Waiting for Redis at $REDISHOST:${REDISPORT:=6379}"
if wait-for-it $REDISHOST:$REDISPORT -q -t ${TESTTIME:=30}; then if wait-for-it $REDISHOST:$REDISPORT -q -t ${TESTTIME:=30}; then
log "Redis found, continuing" log "Redis found, continuing"
else else
log "Redis could not be reached! Exiting..." log "Redis could not be reached! Exiting..."
exit 1 exit 1
@@ -69,4 +69,4 @@ else
ln -s /defaults/nginx/http.conf /etc/nginx/http.d/pterodactyl.conf ln -s /defaults/nginx/http.conf /etc/nginx/http.d/pterodactyl.conf
fi fi
fi fi
log "Initialization complete" log "Initialization complete"