3 Easy Ways to Deploy your Docker Web App on AWS
Jun 22, 2019AWS is shiny
AWS is so, so shiny and awesome, but when I first got started I felt overwhelmed by the sheer amount of stuff. There is so much flexibility, and cli tools, and ways to do anything. Initially, all I wanted to be able to do the things I'd always been able to do, like spin up a server and deploy a docker web application.
Today I am going to share 3 relatively easy methods to deploy your Docker projects on AWS. None of these solutions requires you to have much more AWS specific knowledge than knowing how to login. Having a bit of knowledge of security groups and virtual private clouds (VPC) will be helpful, but never fear! You can deploy your apps!
AWS EC2 Instance
Using the AWS Elastic Compute Cloud (get it? 2 Cs!) is probably the most straightforward and comfortable way for someone, including someone who knows nothing about the AWS ecosystem, to get started, but this is most certainly not a shiny solution.
Elastic Compute Cloud
The AWS Solution when you don't know AWS
If you have a single docker-compose application that doesn't need a bunch of instances behind it, and you're not that comfortable with AWS, this is definitely the easiest solution because it is just like any remote server you have ever used. This is the perfect solution for small projects and demos, but not so great for production web applications or web applications that need to scale.
AWS Elastic Beanstalk
The very first place that my googling led me to was AWS Elastic Beanstalk. I only used it once because while there were things I loved about it, there were other aspects I wasn't so crazy about!
If you have a simple docker-compose stack, and you know how to translate your startup commands from a string to an array you'll be able to get up and going very quickly!
Example
To see an example of deploying a Flask Application on Elastic Beanstalk check out my blog post here.
Docker Swarm on AWS
Now, I know that Docker Swarm is getting pushed out by Kubernetes, and I am jumping on that bandwagon, but I still love Docker Swarm. It's much simpler than Kubernetes, and it can scale out to multiple nodes for large projects. Docker Swarm for AWS is a fantastic balance between relatively simple and robust.
This one is my personal favorite solution for Deploying Docker Applications on AWS
If you have an existing application that was deployed with Docker Swarm then this is the most straightforward solution to get your application out there on AWS. If you need anything a bit fancier, such as GPU, or an elastic cluster as a requirement, then you definitely need a fancier solution. So far, this is my favorite solution for deploying web applications on AWS.
Example
If you want to see how I deploy a Celery Job Queue using Docker for AWS here's a post.