Restart Discourse in Container

AI-generated summary

Restarting Discourse in a Container

Justman10000 asked how to restart Discourse from within a container console. merefield suggested restarting from the Discourse directory, but Justman10000 expressed concerns about losing changes made to container files.

merefield advised that changes will persist if made properly through variables in app.yml, Themes or Theme Components, Plugins, database changes, or uploads. However, Justman10000 noted that editing app.yml requires rebuilding, which merefield partially confirmed, stating that some variable changes apply with a simple restart via the launcher.

The discussion revealed that rebuilding is often necessary for changes to take effect, with merefield suggesting it’s normal and should not be needed more than once a week. syandriz provided alternative rebuild commands: ./launcher rebuild app or ./launcher rebuild app --skip-prereqs.

Hi, when one is in the container in the console, how can one restart Discourse?

Why can’t you restart it from the Discourse directory? The script to do this job is intended to be run from there.

If I do it this way, all the changes I have made to files in the container will be reset when the whole container is restarted…

Your changes will persist if you make them properly:

  • with variables in app.yml
  • with a Theme or Theme Component
  • with a Plugin (if you need to change the behaviour of the back end for example)
  • to the database (preferably via the front end or a rake task)
  • uploads

When I edit the app.yml, I have to rebuild

Not for everything. Some variable changes will apply on a simple restart via the launcher eg SMTP creds I believe.

./launcher restart app

No, the values are the old ones, although I restarted after editing the YML

Which variables?

For sure for many variables you will need to rebuild.

Rebuilding is normal. Embrace it :).

Rebuilding just takes too long

Well you shouldn’t need to rebuild more than once a week? And even then I would use the upgrade page most often to eliminate significant downtime.

yupz. it just take time 15min-30min if you configuration the file app.yml

after edit
you must ./launcher rebuild app
or
you can use this command ./launcher rebuild app --skip-prereqs