简体   繁体   中英

How to add use Github Webhooks to deploy changes to a LEMP server running in Individual Docker Containers

I have a server running ubuntu 18.04 running 3 Docker containers for Nginx, PHP, and MySql . Everything seems to be working correctly within the application which right now is just a test wordpress blog. However I am attempting to add Github Webhook deployments and I am a little lost as to how I should proceed. A few options

  1. Should I setup a webserver on the Host system and trigger a php file to run and execute git pull ? I suppose I could subdomain it to keep SSL validation constant.

  2. Is there a way to pass ssh keys to one of the containers such as the php one and allow that to pull from the repo? I tried this and ran into user and group permission 1000 issues.

  3. Is there a way for the docker containered application of nginx to execute code on the host server(The naked server running docker)?

  4. Is there a simpler solution that I am not thinking of involving deployments? I would prefer not to use a paid service.

Are you using travis-ci or Jenkins to continuous delivery?

These tools help you to do some change in your server when you do a new pull request over your repo of GitHub.

I will show you one project that I was worked using travis-ci where I could deploy my App on Aws or connecting to one host that has docker installed and make new changes.

I'll share you some continuous delivery articles below

Travis continuous delivery

Jenkins SSH credentials setting

Jenkins from scratch CI/CD

Try to get new knowledge about Continuous Integration and Continuous Delivery, is the best way to automate those kinds of processes

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM