Jotty - Discussion about build size improvements with standalone mode (from version 1.14.0) #2202

Closed
opened 2026-02-05 04:11:24 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @fccview on GitHub (Dec 20, 2025).

Originally assigned to: @vhsdream on GitHub.

🌟 Briefly describe the feature

Suggested improvement to Jotty script to conform with the latest standalone mode

📝 Detailed description

Hi @vhsdream
I know you built the script so I am just tagging you directly, hopefully you see this.

I have made an improvement on Jotty from version 1.14.0 where the docker image uses standalone mode, cutting down the size of the image itself from 2.4gb to 300mb.

This is due to the node_modules folder not being needed anymore and I think we can apply the same fix to the proxmox script. I'd open a pull request but I don't run proxmox and I don't have the time to learn how everything works right now just to do this, so I'm just suggesting the change here in the hope you'll just test it and see if it works 😆

Happy to assist/support/help you with any issues you may face, I'll keep my notifications on for this issue and we can figure it out together, but IN THEORY this should just work out of the box

The key change happens after that yarn build where we move the public folder and howto and .next/static folders into that standalone folder that'll be created with the yarn build command, move the standalone folder away, clear the whole folder (including node_modules) and move the standalone back in (so we don't have to hardcode every single file/folder to delete, it's quite a few, but that's up to you, more maintenance in case anything changes).

The rest is pretty much the same. Let me know what you think, HOPEFULLY that'll reduce the build memory usage too as the build is quite different now, but it has nothing to do with this script update, if the memory improved it'd have done it already, so let me know about that ❤️

#!/usr/bin/env bash

# Copyright (c) 2021-2025 community-scripts ORG
# Author: vhsdream
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/fccview/jotty

source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os

NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs
fetch_and_deploy_gh_release "jotty" "fccview/jotty" "tarball" "latest" "/opt/jotty"

msg_info "Installing ${APPLICATION}"
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 <<EOF >/opt/jotty/.env
NODE_ENV=production

# --- Uncomment to enable
# HTTPS=true
# SERVE_PUBLIC_IMAGES=yes
# SERVE_PUBLIC_FILES=yes
# SERVE_PUBLIC_VIDEOS=yes
# STOP_CHECK_UPDATES=yes
# --- For troubleshooting
# DEBUGGER=true

# --- SSO with OIDC (optional)
# SSO_MODE=oidc
# OIDC_ISSUER=<your-oidc-issuer-url>
# OIDC_CLIENT_ID=<oidc-client-id>
# APP_URL=<https://app.domain.tld>
# SSO_FALLBACK_LOCAL=yes
# OIDC_CLIENT_SECRET=your_client_secret
# OIDC_ADMIN_GROUPS=admins
EOF
msg_ok "Installed ${APPLICATION}"

msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/jotty.service
[Unit]
Description=jotty server
After=network.target

[Service]
WorkingDirectory=/opt/jotty
EnvironmentFile=/opt/jotty/.env
ExecStart=/usr/bin/node server.js
Restart=on-abnormal

[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now jotty
msg_ok "Created Service"

motd_ssh
customize
cleanup_lxc

💡 Why is this useful?

It would reduce the Jotty folder size from ~2.4gb to about ~80mb ❤️

Originally created by @fccview on GitHub (Dec 20, 2025). Originally assigned to: @vhsdream on GitHub. ### 🌟 Briefly describe the feature Suggested improvement to Jotty script to conform with the latest standalone mode ### 📝 Detailed description Hi @vhsdream I know you built the script so I am just tagging you directly, hopefully you see this. I have made an improvement on Jotty from version 1.14.0 where the docker image uses standalone mode, cutting down the size of the image itself from 2.4gb to 300mb. This is due to the `node_modules` folder not being needed anymore and I think we can apply the same fix to the proxmox script. I'd open a pull request but I don't run proxmox and I don't have the time to learn how everything works right now just to do this, so I'm just suggesting the change here in the hope you'll just test it and see if it works 😆 Happy to assist/support/help you with any issues you may face, I'll keep my notifications on for this issue and we can figure it out together, but IN THEORY this should just work out of the box The key change happens after that yarn build where we move the `public` folder and `howto` and `.next/static` folders into that `standalone` folder that'll be created with the `yarn build` command, move the standalone folder away, clear the whole folder (including node_modules) and move the standalone back in (so we don't have to hardcode every single file/folder to delete, it's quite a few, but that's up to you, more maintenance in case anything changes). The rest is pretty much the same. Let me know what you think, HOPEFULLY that'll reduce the build memory usage too as the build is quite different now, but it has nothing to do with this script update, if the memory improved it'd have done it already, so let me know about that ❤️ ```bash #!/usr/bin/env bash # Copyright (c) 2021-2025 community-scripts ORG # Author: vhsdream # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/fccview/jotty source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" color verb_ip6 catch_errors setting_up_container network_check update_os NODE_VERSION="22" NODE_MODULE="yarn" setup_nodejs fetch_and_deploy_gh_release "jotty" "fccview/jotty" "tarball" "latest" "/opt/jotty" msg_info "Installing ${APPLICATION}" 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 <<EOF >/opt/jotty/.env NODE_ENV=production # --- Uncomment to enable # HTTPS=true # SERVE_PUBLIC_IMAGES=yes # SERVE_PUBLIC_FILES=yes # SERVE_PUBLIC_VIDEOS=yes # STOP_CHECK_UPDATES=yes # --- For troubleshooting # DEBUGGER=true # --- SSO with OIDC (optional) # SSO_MODE=oidc # OIDC_ISSUER=<your-oidc-issuer-url> # OIDC_CLIENT_ID=<oidc-client-id> # APP_URL=<https://app.domain.tld> # SSO_FALLBACK_LOCAL=yes # OIDC_CLIENT_SECRET=your_client_secret # OIDC_ADMIN_GROUPS=admins EOF msg_ok "Installed ${APPLICATION}" msg_info "Creating Service" cat <<EOF >/etc/systemd/system/jotty.service [Unit] Description=jotty server After=network.target [Service] WorkingDirectory=/opt/jotty EnvironmentFile=/opt/jotty/.env ExecStart=/usr/bin/node server.js Restart=on-abnormal [Install] WantedBy=multi-user.target EOF systemctl enable -q --now jotty msg_ok "Created Service" motd_ssh customize cleanup_lxc ``` ### 💡 Why is this useful? It would reduce the Jotty folder size from ~2.4gb to about ~80mb ❤️
OVERLORD added the enhancement label 2026-02-05 04:11:24 +03:00
Author
Owner

@tremor021 commented on GitHub (Dec 21, 2025):

Damn, thats what i call optimization :) @fccview

@tremor021 commented on GitHub (Dec 21, 2025): Damn, thats what i call optimization :) @fccview
Author
Owner

@fccview commented on GitHub (Dec 21, 2025):

Damn, thats what i call optimization :) @fccview

Ha! Thank you!
Now let's just hope it actually does work this way hahah

@fccview commented on GitHub (Dec 21, 2025): > Damn, thats what i call optimization :) @fccview Ha! Thank you! Now let's just hope it actually does work this way hahah
Author
Owner

@MickLesk commented on GitHub (Dec 21, 2025):

I can prepare it today, @vhsdream is in Christmas season, im in 2h on PC. Should be an easy Task

@MickLesk commented on GitHub (Dec 21, 2025): I can prepare it today, @vhsdream is in Christmas season, im in 2h on PC. Should be an easy Task
Author
Owner

@fccview commented on GitHub (Dec 21, 2025):

I can prepare it today, @vhsdream is in Christmas season, im in 2h on PC. Should be an easy Task

Thank you!

I will try to be around if you have any questions, but it is quite close to Christmas, so lots of preparation going on now haha

@fccview commented on GitHub (Dec 21, 2025): > I can prepare it today, @vhsdream is in Christmas season, im in 2h on PC. Should be an easy Task Thank you! I will try to be around if you have any questions, but it is quite close to Christmas, so lots of preparation going on now haha
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#2202