What is the proper command to restart a Dokku app from SSH?

DockerDigital OceanDokku

Docker Problem Overview


A Rails app I deployed on DigitalOcean using Dokku crashed and started returning 500 errors.

How can I restart it without pushing an empty commit?

Docker Solutions


Solution 1 - Docker

dokku ps:restart <app> works for me logged in with dokku system user.

Use dokku apps to list your apps.

Solution 2 - Docker

If you just want restart the web app, run dokku deploy myapp

Solution 3 - Docker

Found it [there][1]! You have to use Docker restart command directly.

Connect to your server by SSH and run:

```docker restart cat /home/dokku/myapp/CONTAINER


*myapp* being the name of my application. Change the path to your app if needed.


  [1]: https://github.com/progrium/dokku/issues/182#issuecomment-23477252

Solution 4 - Docker

The proper way to restart an app is:

dokku release myapp
dokku deploy myapp

This is how it's done in plugins/config/commands after setting environment variables:

config_restart_app() {
  APP="$1";

  echo "-----> Releasing $APP ..."
  dokku release $APP
  echo "-----> Release complete!"
  echo "-----> Deploying $APP ..."
  dokku deploy $APP
  echo "-----> Deploy complete!"
}

I have sent a pull request to add a dokku restart myapp command.

Solution 5 - Docker

EDIT

The 'new' way appears to be to issue the command 'dokku ps:restart myapp'

END EDIT

An easier way might be to use a plugin:

https://github.com/scottatron/dokku-rebuild

Then issue

dokku rebuild myapp

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSponeView Question on Stackoverflow
Solution 1 - DockerEdu LomeliView Answer on Stackoverflow
Solution 2 - DockermenghanView Answer on Stackoverflow
Solution 3 - DockerSponeView Answer on Stackoverflow
Solution 4 - DockerCameron MartinView Answer on Stackoverflow
Solution 5 - DockerAaron C. de BruynView Answer on Stackoverflow