If you're a fan of docker (like me), you package all your code into docker images, then run them in the cloud in ECS or in an EC2 instance.
AWS ECS is designed to run docker images, but a EC2's (specifically the Amazon Linux2 images) doesn't have docker installed out of the box.
Here's a script that will install docker in less than 60 seconds on an Amazon Linux2 AMI. It also installs docker-compose, so you can run compose files.
You can run this script directly in the EC2 or package it up as part of your user-data and it will install automatically when the new instance is launched.
- Enjoy 😀