Docker and EC2
Setup a EC2 instance eg: t2micro
and keep the ssh key pair and ssh login to your VPC.
Basic Approach
sudo yum update -y
sudo amazon-linux-extras install docker
Now login to your account at Docker Hub (opens in a new tab) and create a new Repository. Make sure you have .dockerignore
properly setup and build your image
docker build -t image-name .
docker tag image-name repository/name # this will now create a new image with the repository name
docker push repository/name
docker login # if you are not logged in
Now your application's image is now available in docker hub which you can run on your remote server.
sudo docker run -d --rm -p 80:80 academind/node-example-1
sudo docker ps # verify the running container
Make sure security group is properly setup.