Triggers slack notification hooks when docker containers go up/down.
In any environment you'll need some variable setup.
HOST # the host you are running this, ie.: http://ec2.amazon-host.com
SLACK_URL=https://hooks.slack.com/... # slack hook url
SLACK_CHANNEL = '#notifications'
# optional
SLACK_USER_NAME # defaults to "Docker Watchdog"
SLACK_USER_ICON # defaults to docker whale icon
WATCHDOG_CONTAINERS # defaults to all containers
docker run --name docker_watchdog --detach --restart=unless-stopped \
-e HOST=http://ec2.amazon-host.com \
-e SLACK_CHANNEL='#notifications' \
-e SLACK_USER_NAME='Docker Watchdog' \
-e SLACK_USER_ICON=https://www.docker.com/sites/default/files/vertical_large.png \
-e SLACK_URL=https://hooks.slack.com/services/keykeykey/keykeykey/keykey \
-e WATCHDOG_CONTAINERS="mongo, myapp, nginx, " \
-v /var/run/docker.sock:/var/run/docker.sock \
leonardofalk/docker-watchdog
yarn install # npm install
# export needed vars
yarn start # npm run start
docker build -t leonardofalk/docker-watchdog .
- Write some tests