In a discussion about displaying an “Under maintenance” page during Discourse rebuilds using nginx, PrettyGirl proposes manually switching nginx configurations to serve a static maintenance page while stopping the Docker container. Stephen points to a canonical meta topic as a reference. pfaffman suggests using a two-container setup to minimize downtime, noting that database upgrades are infrequent and quick. Stephen counters that even this approach may still cause downtime during data container updates. pfaffman then proposes running a temporary nginx container with a “back soon” message during upgrades, though acknowledges the complexity of managing SSL certificates for it. The thread concludes by reaffirming the meta topic as the definitive resource for this issue.
The site maintenance with “./launcher rebuild app” takes some time to fully rebuild the site (installing new plugins etc from git).
Is there any recommended way to show a static page saying “Under maintenance” while I rebuild the discourse?
What I thought was to use nginx. That involves stopping the docker to serve on port 80 and letting nginx reverse proxy to takeover and redirect traffic to either docker container or to my static page.
I’m thinking of doing that with manually editing the nginx.conf to the following whenever needed,
The way I think is better and easier is to use a two container setup so you can build a new container while the old one runs. There is much less down time that way. Others think that running an extra web server is easier.
Major database upgrades happen less than once a year. Minor database upgrades don’t take very long and you can rebuild the data container, destroy and start the web container in a very few minutes. It seems that some people would rather have a pretty message saying that the site is down rather than reducing down time, so a second container is the way to do it.
Actually, maybe the easiest solution would be to just have a second nginx container with a “back soon” message that you ran by hand while doing an upgrade, like
./launcher stop app
docker run nginx --name back-soon # and some more stuff to see that a page was served
./launcher bootstrap app
./launcher destroy app
docker stop back-soon
./launcher start app
But then you have to get a cert and keep the cert updated for the back-soon container, which is complicated.