A simple ExpressJS-based script which can be used to listen to Docker Hub webhooks in order to perform actions, like pulling the new docker image, restarting a container or performing any other actions.
The script is written in TypeScript so you'll
need to install typescript (npm install -g typescript
) in order to compile
it to JavaScript.
Configure the script by changing config.ts
where you can already find a
sample configuration. Afterwards run
tsc --module commonjs app.ts
to compile it to JavaScript.
- Install typescript:
npm install -g typescript
- Update
config.ts
with your personal configuration of webhooks - Compile the typescript files:
tsc --module commonjs app.ts
- Install missing dependencies:
npm install
- Run it:
node .
- To start the script when your server starts, you can use something like https://github.com/chovy/node-startup