diff --git a/tasmoadmin/Dockerfile b/tasmoadmin/Dockerfile index 7e103e3..c972489 100755 --- a/tasmoadmin/Dockerfile +++ b/tasmoadmin/Dockerfile @@ -1,24 +1,4 @@ ARG BUILD_FROM=ghcr.io/hassio-addons/base:15.0.6 -ARG BUILDER=ghcr.io/hassio-addons/base-nodejs:0.1.3 - -# hadolint ignore=DL3006 -FROM ${BUILDER} AS builder - -# Setup base -ARG TASMOADMIN_VERSION="v3.3.3" - -# hadolint ignore=DL3003 -RUN \ - apk add --no-cache \ - git=2.43.0-r0 \ - \ - && git clone --branch "${TASMOADMIN_VERSION}" --depth=1 \ - "https://github.com/TasmoAdmin/TasmoAdmin.git" /var/www/tasmoadmin \ - \ - && cd /var/www/tasmoadmin/tasmoadmin \ - && npm ci \ - && node minify.js \ - && NODE_ENV=production npm ci # hadolint ignore=DL3006 FROM ${BUILD_FROM} @@ -26,7 +6,8 @@ FROM ${BUILD_FROM} # Set shell SHELL ["/bin/bash", "-o", "pipefail", "-c"] -COPY --from=builder /var/www/tasmoadmin/tasmoadmin /var/www/tasmoadmin/tasmoadmin +# Setup base +ARG TASMOADMIN_VERSION="v3.3.3" # hadolint ignore=DL3003 RUN \ @@ -45,20 +26,21 @@ RUN \ && apk add --no-cache --virtual .build-dependencies \ composer=2.7.1-r0 \ \ - && cd /var/www/tasmoadmin/tasmoadmin \ - && composer install --no-dev \ + && curl -J -L -o /tmp/tasmoadmin.tar.gz \ + "https://github.com/TasmoAdmin/TasmoAdmin/releases/download/${TASMOADMIN_VERSION}/tasmoadmin_${TASMOADMIN_VERSION}.tar.gz" \ + && mkdir -p /var/www/tasmoadmin \ + && tar zxf /tmp/tasmoadmin.tar.gz -C \ + /var/www/tasmoadmin --strip-components=1 \ + \ + && cd /var/www/tasmoadmin \ + && rm -r vendor \ + && composer install --no-dev --optimize-autoloader \ \ && apk del --no-cache --purge .build-dependencies \ \ && rm -f -r \ /root/.composer \ - /root/.npm \ - /var/www/tasmoadmin/.docker \ - /var/www/tasmoadmin/.git \ - /var/www/tasmoadmin/.github \ - /var/www/tasmoadmin/.iocage \ - /var/www/tasmoadmin/docker-compose.yml \ - /var/www/tasmoadmin/tasmoadmin/tests \ + /var/www/tasmoadmin/tests \ \ && find /var/www/tasmoadmin -type f -name ".htaccess" -depth -exec rm -f {} \; \ && find /var/www/tasmoadmin -type f -name "*.md" -depth -exec rm -f {} \; \ diff --git a/tasmoadmin/rootfs/etc/nginx/nginx-ssl.conf b/tasmoadmin/rootfs/etc/nginx/nginx-ssl.conf index 302d9d9..8550aa1 100755 --- a/tasmoadmin/rootfs/etc/nginx/nginx-ssl.conf +++ b/tasmoadmin/rootfs/etc/nginx/nginx-ssl.conf @@ -15,7 +15,7 @@ http { server { server_name hassio.local; listen 9541 default_server ssl; - root /var/www/tasmoadmin/tasmoadmin; + root /var/www/tasmoadmin/; ssl_certificate /ssl/%%certfile%%; ssl_certificate_key /ssl/%%keyfile%%; diff --git a/tasmoadmin/rootfs/etc/nginx/nginx.conf b/tasmoadmin/rootfs/etc/nginx/nginx.conf index 400ecf4..242b8ea 100755 --- a/tasmoadmin/rootfs/etc/nginx/nginx.conf +++ b/tasmoadmin/rootfs/etc/nginx/nginx.conf @@ -15,7 +15,7 @@ http { server { server_name hassio.local; listen 9541 default_server; - root /var/www/tasmoadmin/tasmoadmin/; + root /var/www/tasmoadmin/; location / { try_files $uri /index.php$is_args$args; diff --git a/tasmoadmin/rootfs/etc/php82/blacklist.txt b/tasmoadmin/rootfs/etc/php82/blacklist.txt index 4f64366..78ebbe6 100644 --- a/tasmoadmin/rootfs/etc/php82/blacklist.txt +++ b/tasmoadmin/rootfs/etc/php82/blacklist.txt @@ -1,2 +1,2 @@ /data/tasmoadmin/* -/var/www/tasmoadmin/tasmoadmin/data/* +/var/www/tasmoadmin/data/* diff --git a/tasmoadmin/rootfs/etc/s6-overlay/s6-rc.d/init-tasmoadmin/run b/tasmoadmin/rootfs/etc/s6-overlay/s6-rc.d/init-tasmoadmin/run index ba3d340..5b11580 100755 --- a/tasmoadmin/rootfs/etc/s6-overlay/s6-rc.d/init-tasmoadmin/run +++ b/tasmoadmin/rootfs/etc/s6-overlay/s6-rc.d/init-tasmoadmin/run @@ -10,7 +10,7 @@ if ! bashio::fs.directory_exists "/data/tasmoadmin"; then bashio::log.debug 'Data directory not initialized, doing that now...' # Setup structure - cp -R /var/www/tasmoadmin/tasmoadmin/data /data/tasmoadmin + cp -R /var/www/tasmoadmin/data /data/tasmoadmin # Ensure file permissions chown -R nginx:nginx /data/tasmoadmin @@ -19,5 +19,5 @@ if ! bashio::fs.directory_exists "/data/tasmoadmin"; then fi bashio::log.debug 'Symlinking data directory to persistent storage location...' -rm -f -r /var/www/tasmoadmin/tasmoadmin/data -ln -s /data/tasmoadmin /var/www/tasmoadmin/tasmoadmin/data +rm -f -r /var/www/tasmoadmin/data +ln -s /data/tasmoadmin /var/www/tasmoadmin/data diff --git a/tasmoadmin/rootfs/var/www/tasmoadmin/tasmoadmin/.dockerenv b/tasmoadmin/rootfs/var/www/tasmoadmin/.dockerenv similarity index 100% rename from tasmoadmin/rootfs/var/www/tasmoadmin/tasmoadmin/.dockerenv rename to tasmoadmin/rootfs/var/www/tasmoadmin/.dockerenv