From f481e7fd4c1573d60f6b54c3b1fcf9f5ed822f02 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 2 Oct 2023 23:47:04 +0200 Subject: [PATCH] feat: theming script --- container/theme/build.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 container/theme/build.sh diff --git a/container/theme/build.sh b/container/theme/build.sh new file mode 100644 index 000000000..63d3a72fe --- /dev/null +++ b/container/theme/build.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +echo "Starting theme building process..." + +# Install +apt update +apt install -y ca-certificates curl gnupg +mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg + +NODE_MAJOR=20 +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list + +apt update +apt install nodejs -y + +# Build +npm ci --omit dev +su www-data -s npm run build + +# Cleanup +npm cache clean --force +apt purge curl gnupg nodejs -y +apt autoremove -y +rm -r /etc/apt/sources.list.d/nodesource.list +rm -r /etc/apt/keyrings/nodesource.gpg + +rm -rf /app/node_modules/ + +echo "Theme building process complete. Cleaned up all dependecies to save space." \ No newline at end of file