https://github.com/megaconfidence/docker-deploy-webhook
Auto deploys docker containers to a host machine
https://github.com/megaconfidence/docker-deploy-webhook
ci-cd devops docker
Last synced: 2 months ago
JSON representation
Auto deploys docker containers to a host machine
- Host: GitHub
- URL: https://github.com/megaconfidence/docker-deploy-webhook
- Owner: megaconfidence
- Created: 2020-10-22T07:49:26.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-10-26T17:57:46.000Z (over 4 years ago)
- Last Synced: 2025-02-08T22:46:32.658Z (4 months ago)
- Topics: ci-cd, devops, docker
- Language: JavaScript
- Homepage:
- Size: 51.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker Deploy Webhook
This is a simple webhook that auto deploys docker images on a self managed host such as VM or your local computer with docker installed
It is designed to work with a CI/CD flow either on travis, circle or git actions. After running your test etc, this webhook is to be called on the deploy stage of your pipeline and will auto deploy the docker image of the given repository on the host it is running on
## Demo Video
See how this webhook works by playing the video below[](https://youtu.be/yNPahpRavCc)
## Requirements
1. Linux/Unix host i.e [Ubuntu](https://ubuntu.com/download/server)
2. [Docker engine](https://docs.docker.com/engine/install/)
3. [Nodejs](https://nodejs.org/en/download/package-manager/)
4. [PM2](https://pm2.keymetrics.io/)## Environment Variables
This webhook requires the following environment variables
```
WEBHOOK_PORT=
DEPLOY_KEY=
REPO_URL=
IMAGE_NAME=
CONTAINER_NAME=
```Your can add other env variables that would be needed by the container at run-time to the `.env` file. These variables would be used to build the image, making them available when the container restarts (make sure you have your `ARG`s and `ENV`s properly setup in your `Dockerfile`)
## Scripts
This webhook runs on a Nodejs server managed by PM2. The available scripts are:
### Start
Starts the server in a daemonized process
```
yarn start
```### Stop
Kills the server process
```
yarn stop
```### Dev
Starts the server in development mode
```
yarn dev
```
### Startup
If you want the webhook to automatically start on boot
```
npm i -g pm2
yarn start
pm2 startup
```## Contributing
Your contributions are welcome. Please feel free to make suggestions and raise issues