https://github.com/ericm/healscript
Docker image that runs a user-defined script whenever a specific container becomes unhealthy
https://github.com/ericm/healscript
docker docker-compose docker-health-check health-check
Last synced: 9 months ago
JSON representation
Docker image that runs a user-defined script whenever a specific container becomes unhealthy
- Host: GitHub
- URL: https://github.com/ericm/healscript
- Owner: ericm
- Created: 2020-05-03T21:35:06.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-06T10:50:33.000Z (almost 6 years ago)
- Last Synced: 2025-02-02T00:27:25.753Z (about 1 year ago)
- Topics: docker, docker-compose, docker-health-check, health-check
- Language: Shell
- Homepage: https://hub.docker.com/r/moynihan/healscript
- Size: 7.81 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker HealScript
This is a Docker image that runs a user-defined script whenever a specific container becomes unhealthy.
It maps to scripts in the `/scripts` directory and if an image _X_ is found to be unhealthy, it will run `/scripts/X.sh`
## Usage
## docker
```sh
docker run -it \
-v /path/to/scripts:/scripts \
-v /var/run/docker.sock:/var/run/docker.sock \
moynihan/healscript:latest
```
### docker-compose
```yml
version: "3"
services:
healscript:
image: moynihan/healscript:latest
volumes:
- /path/to/scripts:/scripts
- /var/run/docker.sock:/var/run/docker.sock
```
## Example script
```sh
# /script/X.sh
docker logs Y
docker restart X Y Z
```
## [Images](https://hub.docker.com/r/moynihan/healscript)
- `moynihan/healscript:{latest|x86_64}`
- `moynihan/healscript:armhf`
Based off of https://github.com/willfarrell/docker-autoheal