Hi guys,
I would like some advice on ‘best practice’ for deploying projects to a DigitalOcean Droplet.
I have a number of hobby projects that are compiled with Docker, either webpages built with Node.js or python API’s. My usually process is:
I have recently automated step 3 with GitHub workflows.
The process has served me well without complaints when projects are small but I am now becoming more space conscious - my git repositories often include files that aren’t necessary for deployment.
So my question is: what is the best practice method for deploying projects compiled with Docker?
Some of my thoughts are:
Am I going about this the right way? Any advise would be appreciated.
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!
Hi there,
Yes, indeed you are definitely going in the right direction.
What I would usually do in this case is, as you said, have the Docker images ready and just pull them, rather than building the images each time on your Droplet.
As you are already using GitHub, what you could do is to use GitHub actions to do that.
Actually there is already one available on the GitHub Marketplace which I believe will serve you well:
https://github.com/marketplace/actions/build-and-push-docker-images
That way you will have your images ready and you will only need to pull them and run them.
Hope that this helps! Regards, Bobby
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.