Update and repair image
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -69,8 +69,9 @@ ENV S6_BEHAVIOUR_IF_STAGE2_FAILS="2"
|
|||||||
COPY --from=build --chown=nginx:nginx /var/www /var/www
|
COPY --from=build --chown=nginx:nginx /var/www /var/www
|
||||||
COPY root/ /
|
COPY root/ /
|
||||||
|
|
||||||
# Download latest S6-Overlay build from project repository: https://github.com/just-containers/s6-overlay
|
# Download latest S6-Overlay components from project repository: https://github.com/just-containers/s6-overlay
|
||||||
ADD https://github.com/just-containers/s6-overlay/releases/download/v2.2.0.3/s6-overlay-amd64-installer /tmp/s6-overlay
|
ADD https://github.com/just-containers/s6-overlay/releases/latest/download/s6-overlay-noarch.tar.xz /tmp
|
||||||
|
ADD https://github.com/just-containers/s6-overlay/releases/latest/download/s6-overlay-x86_64.tar.xz /tmp
|
||||||
|
|
||||||
# Download latest Wait-For-It script from project repository: https://github.com/vishnubob/wait-for-it
|
# Download latest Wait-For-It script from project repository: https://github.com/vishnubob/wait-for-it
|
||||||
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
|
||||||
@@ -79,8 +80,9 @@ ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.s
|
|||||||
ADD https://bitbucket.org/Gethec/projecttools/raw/master/DockerUtilities/ContainerTools /usr/bin/ContainerTools
|
ADD https://bitbucket.org/Gethec/projecttools/raw/master/DockerUtilities/ContainerTools /usr/bin/ContainerTools
|
||||||
|
|
||||||
# Install S6-Overlay and Wait-For-It
|
# Install S6-Overlay and Wait-For-It
|
||||||
RUN chmod u+x /tmp/s6-overlay /usr/local/bin/wait-for-it && \
|
RUN chmod u+x /usr/local/bin/wait-for-it && \
|
||||||
/tmp/s6-overlay / && \
|
tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz && \
|
||||||
|
tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && \
|
||||||
# Remove preinstalled conf files
|
# Remove preinstalled conf files
|
||||||
rm -rf \
|
rm -rf \
|
||||||
/tmp/* \
|
/tmp/* \
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
#!/command/with-contenv bash
|
||||||
source ContainerTools
|
source ContainerTools
|
||||||
SNAME=${BASH_SOURCE##*/}
|
SNAME=${BASH_SOURCE##*/}
|
||||||
|
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
|
||||||
@@ -27,7 +28,7 @@ fi
|
|||||||
# Check for persistent storage directory, create file structure if not present.
|
# Check for persistent storage directory, create file structure if not present.
|
||||||
if [ ! -d "/config/storage" ]; then
|
if [ ! -d "/config/storage" ]; then
|
||||||
log "Creating storage directory"
|
log "Creating storage directory"
|
||||||
cat .storage.tmpl | while read line; do
|
cat $WORKDIR/.storage.tmpl | while read line; do
|
||||||
mkdir -p "/config/${line}"
|
mkdir -p "/config/${line}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
@@ -42,17 +43,17 @@ fi
|
|||||||
if [ ! -e /config/pterodactyl.conf ]; then
|
if [ ! -e /config/pterodactyl.conf ]; then
|
||||||
log "Config file does not exist, creating template"
|
log "Config file does not exist, creating template"
|
||||||
log "[WARN] Connect to container and finish setup process"
|
log "[WARN] Connect to container and finish setup process"
|
||||||
cp .env.example /config/pterodactyl.conf
|
cp $WORKDIR/.env.example /config/pterodactyl.conf
|
||||||
log "Generating unique Pterodactyl key"
|
log "Generating unique Pterodactyl key"
|
||||||
log "$(php artisan key:generate --force --no-interaction)"
|
log "$(php $WORKDIR/artisan key:generate --force --no-interaction)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clear views and autogenerated configs on launch. This is necessary for updates, and doesn't affect non-update launches.
|
# Clear views and autogenerated configs on launch. This is necessary for updates, and doesn't affect non-update launches.
|
||||||
log "$(php artisan view:clear)"
|
log "$(php $WORKDIR/artisan view:clear)"
|
||||||
log "$(php artisan config:clear)"
|
log "$(php $WORKDIR/artisan config:clear)"
|
||||||
log "Checking for database updates, preparing cache"
|
log "Checking for database updates, preparing cache"
|
||||||
log "[NOTE] This will fail if the database connection has not yet been configured"
|
log "[NOTE] This will fail if the database connection has not yet been configured"
|
||||||
log "$(php artisan migrate --seed --force)"
|
log "$(php $WORKDIR/artisan migrate --seed --force)"
|
||||||
chown -R nginx:nginx /config/
|
chown -R nginx:nginx /config/
|
||||||
|
|
||||||
# Load selected Nginx conf.
|
# Load selected Nginx conf.
|
@@ -1,2 +1,2 @@
|
|||||||
#!/usr/bin/execlineb -P
|
#!/command/execlineb -P
|
||||||
/usr/sbin/crond -fL /dev/null
|
/usr/sbin/crond -fL /dev/null
|
@@ -1,2 +1,2 @@
|
|||||||
#!/usr/bin/execlineb -P
|
#!/command/execlineb -P
|
||||||
/usr/sbin/nginx -g "daemon off;"
|
/usr/sbin/nginx -g "daemon off;"
|
@@ -1,2 +1,2 @@
|
|||||||
#!/usr/bin/execlineb -P
|
#!/command/execlineb -P
|
||||||
/usr/sbin/php-fpm -Fc /etc/php
|
/usr/sbin/php-fpm -Fc /etc/php
|
@@ -1,3 +1,3 @@
|
|||||||
#!/usr/bin/execlineb -P
|
#!/command/execlineb -P
|
||||||
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
|
Reference in New Issue
Block a user