By yassin
There is no error to post… I’ve implemented the Hello-world app via docker-compose on my laptop (Macbook pro). I want to follow a simple good approach to deploy it to Digital ocean and to automate this deployment (heroku-like).
Thanks in advance!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I got one idea on my mind how you can do it. Heroku is based on GitHub, you connect desired repo to it and you use however you want.
So we can do something like this. Idea is to look repo where you store code for changes, once you change something, pull it on the server. Here comes Git Hooks. It has many features, but one of useful could be execute script on push. In script, instruct server to fetch changes. How To Use Git Hooks To Automate Development and Deployment Tasks will help you understand how it works and how to make it. This tutorial should work for any Git based solution (e.g. GitHub, GitLab).
Beside Git Hooks, GitHub offers you Webhooks. Webhook will send HTTP POST request to your server once you do something in repo. You select which action you want to watch. This will require to set up app on server that will parse HTTP POST request. App can be in any language that can parse HTTP requests (e.g. Ruby (example on GitHub site is written in Ruby/Sinatra), JS/Node, Go…).
GitLab also has Webhooks which is handy if your prefer it over GitHub.
DigitalOcean doesn’t have Webhooks tutorial, but there is chance it appears. :)
You can combine this with Docker/Docker Compose if you want. This is not a needed step, above will work flawless without Docker, but if you want better management, go on Docker can be very helpful. I’ll leave you few DO resources that can help you get started: How To Install and Use Docker on Ubuntu 16.04. How To Install Docker Compose on Ubuntu 16.04. Next one is excellent article, maybe it’ll give you some more ideas: How To Configure a Continuous Integration Testing Environment with Docker and Docker Compose on Ubuntu 16.04.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.