Automatic container deployment system using Github webhook
- Webhook endpoint designation
- Docker interworking
- Create container image
- Create container
- Git clone and download
- Fix git clone event
- Edit image tag
- Container version control
- Event logic separation
- Auth Git clone
- Patch container env.
start
npm run start
start(production)
npm run start:prod
start(development)
npm run start:dev
endpoint url
https://test.test/api/webhook/github
./backend/config/setting.json
{
"GITHUB_SECRET":"<github_webhook_secret>",
"GITHUB_PAT":"",
"CLONE_REPO_DIR":"<github_repo_local_dir>",
"ENABLE_USERS":["DipokalLab"]
}
docker run --detach \
--name deploy-nginx-proxy \
--publish 80:80 \
--publish 443:443 \
-e HTTP_PORT=80 \
-e HTTPS_PORT=443 \
--volume certs:/etc/nginx/certs \
--volume vhost:/etc/nginx/vhost.d \
--volume html:/usr/share/nginx/html \
--volume /var/run/docker.sock:/tmp/docker.sock:ro \
nginxproxy/nginx-proxy:alpine
docker run --detach \
--name deploy-nginx-proxy-letsencrypt \
--volumes-from deploy-nginx-proxy \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
--volume acme:/etc/acme.sh \
--env "[email protected]" \
nginxproxy/acme-companion
Then create and run a './deployenv' file on the service. An example of a 'deployenv' file. Separators are commas.