Add missing restart-policy documentation

This commit is contained in:
Jose Diaz-Gonzalez
2016-07-30 16:46:59 -04:00
parent 159e6e8c98
commit cc05a64fbe

View File

@@ -1,6 +1,6 @@
# Process and Container Management
> New as of 0.3.14
> New as of 0.3.14, Enhanced in 0.7.0
```
ps <app> # List processes running in app container(s)
@@ -11,6 +11,8 @@ ps:restart <app> # Restart app container(s)
ps:scale <app> <proc>=<count> [<proc>=<count>] # Set how many processes of a given process to run
ps:start <app> # Start app container(s)
ps:stop <app> # Stop app container(s)
ps:restart-policy <app> # Shows the restart-policy for an app
ps:set-restart-policy <app> <policy> # Sets app restart-policy
```
By default, Dokku will only start a single `web` process - if defined - though process scaling can be managed by the `ps` plugin or via a custom `DOKKU_SCALE` file.
@@ -37,3 +39,28 @@ worker=2
```
> *NOTE*: Dokku will always use the DOKKU_SCALE file that ships with the repo to override any local settings.
## Restart Policies
> New as of 0.7.0
By default, Dokku will automatically restart containers that exit with a non-zero status up to 10 times via the [on-failure Docker restart policy](https://docs.docker.com/engine/reference/run/#restart-policies-restart). You can configure this via the relevant `ps` commands:
```shell
# always restart an exited container
dokku ps:set-restart-policy node-js-app always
# never restart an exited container
dokku ps:set-restart-policy node-js-app no
# only restart it on Docker restart if it was not manually stopped
dokku ps:set-restart-policy node-js-app unless-stopped
# restart only on non-zero exit status
dokku ps:set-restart-policy node-js-app on-failure
# restart only on non-zero exit status up to 20 times
dokku ps:set-restart-policy node-js-app on-failure:20
```
Restart policies have no bearing on server reboot, and Dokku will always attempt to restart your applications at that point unless they were manually stopped.