How would you deploy a simple web application to a single VM?

・1 min read

When deploying a simple web application to a virtual machine, how do you go about setting it up?

  • Do you install the required runtime, if any, (like Python, Ruby, NodeJS) directly on the VM? Do you create systemd unit files to launch the application on startup?
  • Do you use vagrant?
  • Do you use Docker
  • Do you do something completely different

Why do you choose that particular way of deploying?

DISCUSSION (5)
 

I use Docker. It takes time to understand it and learn some basic stuff and commands, but at the end you will get a sustainable, predictable, scalable way of running your apps.
Just an example. You have some simple app backed, frontend, maybe Redis and some database. You prepared docker compose file once for development, then you could use almost the same configuration for production. If you configured it once very well you could use it everywhere, migrate from one host to another without having troubles with running tons of commands. Then let's imagine your app or product getting more and more parts. You managed to have CI, and it's not a problem because you already have dockerfile configured. Then if you start use orchestration tools such as Kubernetes, it also will not be a problem, because your dockerfile already there.

 

I'm currently using Docker for this, but it's starting to feel like overkill for most of my personal use cases - my Rust roll-your-own-website is a 5MB binary but rebuilds include all my deps, so pushing changes generally involves pushing hundreds of megabytes of recalc'd layers around. Curious to see what people have to say here - I dig the convenience, just not the bandwidth.

 
 

No docker, no vagrant, no goddamn Kubernetes or any other bloated junk. As my friend said "for some people 'portable' does not mean 'it runs on Ubuntu and CentOS' ".

 
Classic DEV Post from Oct 31 '18

Lessons in my First Month of Active Blogging

Blogging actively has been an intense and rewarding process thus far, and I've taken this week to reflect on it!

Frederik πŸ‘¨β€πŸ’»βž‘οΈπŸŒ Creemers
I'm never sure what to put in a bio. If there's anything you want to know, don't be afraid to ask!

Still don't have a dev.to account? You're welcome to lurk, but it's better to be part of the community.

Sign up now ❀️