How to stop docker and shutdown droplet cleanly for digitalocean snapshot backups


(Tobias Eigen) #1

Apologies for the newb question.

My preferred workflow has been to do a snapshot on the digitalocean dashboard before doing discourse updates, in case Bad Things Happen. As I am realizing now, just running shutdown now -h appears to not be enough and shuts down the server while docker is running. Do I need to run this instead?

cd /var/discourse && ./launcher stop app && shutdown now -h

Is there a way to add this to a shutdown process so that the shutdown is clean? Or am I wrong in pinpointing this as the source of my woes? Is there another way my database could be getting corrupted?


Properly shut down Discourse when host shuts down
(BRNDR) #2

I too would like to know the answer to this. Although it may be better if we asked Digital Ocean directly. My guess is that it doesn’t matter if Docker is stopped before shutting down your Droplet.


(Jeff Atwood) #3

The bad news is that we weren’t actually doing a proper DB shutdown in our current Docker image which might have led to some of the current problems.

@sam worked on this recently and fixed it, to get a new image, git pull from the /var/docker folder and then ./launcher rebuild app.

Now that we’ve done that, yes, all you should need to do is ./launcher stop app to shut down cleanly.


(Tobias Eigen) #4

Awesome - I am so glad to have this sorted out and to know the best practice. Living and learning…


(Régis Hanol) #5