Recommendation: Deploy Docker application to AWS - amazon-web-services

I got a local Docker stack running Node.js, MongoDB and Nginx.
It runs perfectly using docker-compose up --build.
Now it's time to deploy my application to a production environment.
I have considered EC2 Container Service and EC2, but can you recommend an easier approach? The learning curve is steep!

For MongoDB -
Use AWS quick start MongoDB
http://docs.aws.amazon.com/quickstart/latest/mongodb/overview.html
http://docs.aws.amazon.com/quickstart/latest/mongodb/architecture.html
For rest of the docker stack i.e NodeJS & Nginx -
Use the AWS ElasticBeanstalk Multi Container Deployment
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_ecs.html
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_v2config.html

Elastic Beanstalk supports Docker, as documented here. Elastic Beanstalk would manage the EC2 resources for you so that you, which should make things a bit easier on you.

You can install Kontena to AWS and use that to deploy your application to production environment (of course other cloud providers are also supported). Transition from Docker Compose is very smooth since kontena.yml uses similar syntax and keys as docker-compose.yml.
With Kontena you will have private image registry, load balancer and secret management built-in that are very useful when running containers in production.

Related

How to Deploy production grade Jenkins server?

I want to deploy Jenkins on AWS but I don't know what is the best way to deploy it.
I watched videos and read articles and below are some possible solutions.
1- Jenkins as a docker container, bind the volume and expose it with ELB or Nginx reverse proxy.
2- Jenkins on EKS or unmanaged K8s cluster and expose it via ELB.
3- Install as a regular application via an apt-get command in EC2 and expose it via Nginx reverse/ELB.
I don't know what is the best way to deploy in production.
P.S: next plan is to deploy our Nexus and Sonarqube servers as well.
Thanks in advance :)
Well it completely depends on many factors such as:
Cost
Number of users (High availability)
If cost isn't a big issue, you can use Amazon EKS cluster to deploy highly available Jenkins server.
Checkout this guide on how to do it on EKS.

Why AWS is retiring Elastic Beanstalk with multi container support?

I was looking at using Elastic Beanstalk with Multicontainer support, although, it seems that AWS is scheduling the retirement of this platform / functionality.
Here is the documentation for supported platform for Elastic Beanstalk: https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-supported.html
I used the Docker version 64bit Amazon Linux 2 v3.4.4 running Docker and that version does not support using Dockerrun.aws.json version 2 with multi containers support.
So then I came across this documentation: https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platforms-retiring.html#platforms-retiring.mcdocker
Multi containers support is marked as retiring platform, I was wondering why basically?
Is there a version coming soon or Elastic Beanstalk would just stop doing multi containers support?
Thanks a lot!
The Multicontainer Docker (Amazon Linux AMI) was based on ECS to support muliti-container docker. But since regular Docker environment now supports docker-compose you can multi-containers without ECS:
Docker Compose features. This platform will allow you to leverage the features provided by the Docker Compose tool to define and run multiple containers. You can include the docker-compose.yml file to deploy to Elastic Beanstalk.
Docker Compose makes is much easier to use multi-containers on EB, thus support for ECS seems redundant.
I believe this tool will be used for containerized web applications- https://aws.amazon.com/apprunner/

Deploying a web application for Selenium testing on AWS EC2

I have a web application that uses Selenium in backend to run few scripts when invoked by user. I want to deploy this web app on AWS.
Here are my findings so far:
I can have a windows EC2 instance created and then I can install tomcat, firefox and all the necessary stuff. Then using putty or any other client, I can deploy my war and start tomcat.
I can directly make use of Elastic Beanstalk and deploy my war file there itself but then, there is no windows EC2 available for beanstalk and I don't know how to install firefox there and make my application work.
What is the best way to achieve this and what steps should I follow. I want to install a specific firefox version to be able to make it run with my selenium scripts.
There are two separate things here:
Deployment of web application on AWS cloud
Run the selenium tests against your web application
According to me, you should first think of deploying a web application to AWS cloud. There are many ways by which you can get it deployed to AWS cloud with below services:
Spin a new AWS EC2 instance, install all required software and deploy the web application.
Use AWS elastic beanstalk service with either with tomcat or docker.
Use AWS ECS if you prefer docker
According to me, second option will be quick for you with tomcat environment option. If you select tomcat environment, then your platform will be Tomcat 8 Java 8 on 64bit Amazon Linux.
Now, here comes the second part. You can have below options for your browser environments.
Spin a new separate AWS EC2 instances with correct AMI and install your specific browsers on these instances.
If you prefer SaaS, then you can take a look at browserstack or SauceLabs for remote environment.
If you have CI(jenkins/travis/Circle CI), then make use of that infrastructure to luanch your tests with either option from the above.

Deploy Docker environment on Elastic Beanstalk

I just "Dockerized" my infrastructure into containers. The environment basically is one nginx-php-fpm container which contains nginx configured with php-fpm. This container connects to multiple data-containers which contains the application files for the specific component.
I've seen multiple talks on deploying a single container to Beanstalk, but I'm not sure how I would deploy an environment like this. Locally the environment works. I got my nginx-php-fpm container using the --volumes-from flag to a data-container.
How would I create the same environment on Beanstalk? I can't find the option to volume from another container. Also is there a good platform that handles the Docker orchestration yet?
AWS allows you to use multicontainer docker.
You can use docker-compose to help you to create your nginx-php-fpm environment.

AWS ElasticBeanstalk in a production environment

I wonder about the choice of AWS Elastic Beanstalk as an environment for the production system. Do you have some experience in this regard?
More info as I have been using EB for more than 8 months...
So far so good, elastic beanstalk has its limitation though.
It is designed for service handling, but when you just want a processing unit, you need to do something additional for ELB and autoscaling.
Fixed in latest release: No VPC yet, so your Elastic Beanstalk is still exposed to the internet., but VPC support is limited and need manually config through config files.
Fixed in latest release: Not easy to customize the webserver (e.g. tomcat) you have to use your own images.
Limited tuning option on the webserver parameter.
From my experience, reliability is OK not great, the main problem is the EB automation scripts sometime can stuck you environment.
But overall I like it.
We deployed our Java webapplication (all three environments) Beta, Staging and live on ElasticBeanStalk. They are doing well, so far we haven't faced any issues with Elastic Beanstalk.