Skip to content

Instantly share code, notes, and snippets.

@mochja
Last active September 20, 2019 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mochja/b5ab530770966d6dd21cc9996fe2da83 to your computer and use it in GitHub Desktop.
Save mochja/b5ab530770966d6dd21cc9996fe2da83 to your computer and use it in GitHub Desktop.
[Unit]
Description=Update nginx config on docker container restart
After=docker.service
[Service]
Type=simple
ExecStart=/root/dokku-update-nginx-on-container-restart.sh
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target
#!/bin/bash
docker events --filter "org.label-schema.vendor=dokku" --filter "event=restart" --format "{{index .Actor.Attributes \"com.dokku.app-name\"}}" | xargs -L1 -I % dokku nginx:build-config % -t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment