YunoHost-Apps / umami_ynh

Umami package for YunoHost
https://umami.is/
GNU General Public License v3.0
3 stars 2 forks source link

Consider keeping only productions assets #6

Open nicofrand opened 1 year ago

nicofrand commented 1 year ago

Describe the bug

Not a bug per se but the installation takes quite a lot of space: 2.4G:

I have a really limited disk space on my VPS and this is quite a lot.

During the installation all the dependencies (dev & prod) are installed, to be able to build the app (yarn build) and then run it.

Removing dev dependencies once the build step is finished would avoid some unused assets.

I believe this would be possible by adding the steps below in https://github.com/YunoHost-Apps/umami_ynh/blob/master/scripts/install#L132-L136:

  1. rm .cache/yarn/* -rf
  2. rm node_modules -rf
  3. yarn install --production

This basically removes the dependencies and reinstall the project in production.

Context

nicofrand commented 1 year ago

FYI: removing the yarn cache and clearing the dev dependencies are two different things, which are not linked, and can be done separately.

orhtej2 commented 10 months ago
Info: Backing up the database...
Info: Backup script completed for umami. (YunoHost will then actually copy those files to the archive).
Info: Creating a backup archive from the collected files...
Info: The archive will contain about 3.3GB of data.

☠️

orhtej2 commented 9 months ago

33 is now ready for testing.

You can give it a spin by running sudo yunohost app upgrade umami -u https://github.com/orhtej2/umami_ynh/tree/slim_prod after making proper backup, just in case.

I'll keep it as draft to get some results in.

nicofrand commented 9 months ago

Worked like a charm. Directory now takes ~1.2G (node_modules still taking 1.1G). Thanks!

orhtej2 commented 9 months ago

Worked like a charm. Directory now takes ~1.2G (node_modules still taking 1.1G). Thanks!

node_modules actually seem necessary, what's present in slimed down version is a subset as per https://github.com/umami-software/umami/blob/master/Dockerfile

orhtej2 commented 9 months ago

Also-also please don't upgrade from master, stuff will likely break. I'll keep the slim_prod aligned with testing for the time being.

nicofrand commented 9 months ago

Worked like a charm. Directory now takes ~1.2G (node_modules still taking 1.1G). Thanks!

node_modules actually seem necessary, what's present in slimed down version is a subset as per https://github.com/umami-software/umami/blob/master/Dockerfile

Yes of course. Still, a few MB were earned on that directory :)