Watching a config for changes requires a subscription on the Team plan.
The Doppler CLI can automatically restart your process when your secrets change.
To enable auto restart of your process, pass the
--watch flag to the
doppler run command.
doppler run --watch -- ./your_command.sh
Doppler's CLI strongly prioritizes the uptime of your application. Your process is only restarted once the latest secrets are successfully fetched. Additionally, your initial command is executed immediately, before the CLI attempts to watch for changes. This ensures that an inability to watch for changes does not prevent your process from starting.
The CLI's restart logic is as follows:
- CLI receives message over long-lived HTTP connection indicating secrets have changed
- CLI fetches the latest secrets
SIGTERMis sent to the originally started process
- CLI waits up to 10 seconds for the process to exit
- If process still hasn't exited,
- If using
--mountflag, secrets file is remounted with the latest secrets
- Originally provided command is re-run
When multiple instances of the CLI are watching the same Doppler config, they will all receive the latest secrets at roughly the same time. This effectively means that all processes will be restarted at the same time. This can result in downtime when used in production. For production use cases, it is recommended to instead use the Doppler Kubernetes Operator.
Updated about 1 month ago