Which nodebb files/directories need to be persisted?



  • I'm building a dockerized nodebb, and I need to decide which folders should go into a persisted volume to survive rebuilds/restarts... package.js is updated every time you install a plugin, but is anything else updated? public/stylesheets seems modified? Am I best off persisting everything?


  • Gamers

    As far as I know only ~/public/uploads. I'm not sure if that's still needed when using the imgur plugin.



  • What about package.json. Don't you need that? (the plugins are in there...) Do you just reinstall them on a restore?


  • Gamers

    Do you want to recompile everything when you start an instance? I think it may be better to keep node_modules included in the system image. This spares a lot of computation time for compiling, and bandwidth for receiving the data.

    If you decide to omit the node_modules directory then package.json is crucial indeed, but the same thing holds for every nodebb system file.



  • So, I tried it out. Turns out package.json is NOT updated when you install a plugin. However, node_modules is updated since installing a plugin actually does npm install. I want a completely redeployable container, so I think the only way right now is to install plugins by changing package.json in my github repo. Not the most flexible way, but on the other hand being able to deploy the forum to another server in 10 minutes if something brakes is pretty useful...


  • FreeBSD/OpenBSD

    I don't know if it will be helpful to you but I have started to work on a small shell script to save and restore NodeBB. In my setup, NodeBB is installed using the package system so all the modules present in package.json are already present. It just make a difference between what is present and what should be present. Note also that the current version only deals with plugin. This is a bad idea and will change in a near future.

    Here is the github repo : https://github.com/Hukadan/nodebbutils/blob/master/nodebbutils


    ❗ this is a work in progress so use it with care on machines you do not care about (at least for the moment) ❗


  • Swedes

    I remove everything on each upgrade except the files in (/public/uploads) 🙂



  • @Jenkler So how do you keep your installed plugins?

    (the way I do it now is install plugins locally with npm -S so they go into package.json and then push to deploy on the server)


  • Swedes

    That is how i Do it 😉 I guess you can figure it out even if its in Swedish 😛


Log in to reply
 


Looks like your connection to NodeBB was lost, please wait while we try to reconnect.