0
2.2kviews
Run your application with docker-compose on AWS EC2
1 Answer
written 3.9 years ago by |
For creating a powerful App Server which can serve 2 million requests per month, take a new EC2 instance having 4 vCPUS, 16GB RAM, and running Ubuntu 18.04.
And follow these steps:
1. Install docker
2. Install docker-compose
3. Install and setup aws cli
4. Pull images from ECR
Before docker-compose can access images hosted on ECR, we need to docker login
.
Commands:
$ aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 781335429294.dkr.ecr.us-east-1.amazonaws.com
$ docker-compose up -d
Reserver an Elastic IP address
Reserve an Elastic (fixed) IP address and associate it with the app server. Otherwise every time, the app server is restarted, the new IP address will be assigned to it and break domain name pointing.