From f139c6960f258d96b871b060761ffa397ccfd118 Mon Sep 17 00:00:00 2001 From: MickLesk Date: Sun, 21 Dec 2025 22:57:33 +0100 Subject: [PATCH] Optimize Jotty installation with standalone mode - Use Next.js standalone mode to reduce folder size from ~2.4GB to ~80MB - Copy public, howto, and static folders to standalone output - Remove node_modules and build artifacts after creating standalone version - Update systemd service to use node directly instead of yarn start - Improves build efficiency and reduces disk usage Implements #10178 Co-authored-by: fccview --- install/jotty-install.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/install/jotty-install.sh b/install/jotty-install.sh index 7eb82583f..d5cc534c3 100644 --- a/install/jotty-install.sh +++ b/install/jotty-install.sh @@ -21,6 +21,18 @@ cd /opt/jotty $STD yarn --frozen-lockfile $STD yarn next telemetry disable $STD yarn build + +[ -d "public" ] && cp -r public .next/standalone/ +[ -d "howto" ] && cp -r howto .next/standalone/ +mkdir -p .next/standalone/.next +cp -r .next/static .next/standalone/.next/ + +mv .next/standalone /tmp/jotty_standalone +rm -rf * .next .git .gitignore .yarn +mv /tmp/jotty_standalone/* . +mv /tmp/jotty_standalone/.[!.]* . 2>/dev/null || true +rm -rf /tmp/jotty_standalone + mkdir -p data/{users,checklists,notes} cat </opt/jotty/.env @@ -55,7 +67,7 @@ After=network.target [Service] WorkingDirectory=/opt/jotty EnvironmentFile=/opt/jotty/.env -ExecStart=yarn start +ExecStart=/usr/bin/node server.js Restart=on-abnormal [Install]