Use release artifacts (#389)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Malachi Soord 2024-03-22 18:12:00 +01:00 committed by GitHub
parent ede974f859
commit 6fbb38a75d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 18 additions and 36 deletions

View file

@ -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 {} \; \

View file

@ -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%%;

View file

@ -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;

View file

@ -1,2 +1,2 @@
/data/tasmoadmin/*
/var/www/tasmoadmin/tasmoadmin/data/*
/var/www/tasmoadmin/data/*

View file

@ -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