Deploying specific docker services locally when running docker-compose with ECS - amazon-web-services

I have a docker-compose.yml file that deploys several services to AWS ECS. This works fine. However, there are some services that I don't want deployed to ECS. I would like for these docker containers to run locally instead WHILE the other services are deployed on AWS ECS.
I can't find any documentation on this. What settings would I have to set in my docker-compose.yml file so that a specific service is built and run locally instead of being deployed to AWS ECS?

It sounds like you need to create two separate docker-compose.yaml files. One could be called local-only-compose.yaml or something. When running locally you can pass multiple compose YAML files to docker-compose. When deploying to AWS you could pass only the file with the services you want to deploy to ECS.

Related

How properly deploy Docker Compose to Amason EC2 instance?

I'm having docker-compose config with postgres, 2*python, nginx and redis services. Now I'm instantiated an ec2 instance and successfully logged in via .pem file. But I expected, that I can deploy my docker-compose image only with aws-cli commands. My question is should I instantiate ec2 for each of service and how to use ec2 with docker-compose properly?
How you want to design your infrastructure - how many servers, autoscaling, routing, etc - is entirely up to you.
To answer your question though; to deploy a docker-compose.yml file you do so the same as you would on any other server.
docker-compose is a tool made for development and is not made to be used in Production - you should deploy your services with:
docker stack deploy -c your-compose-file.yml your_stack_name
It sounds like this is new to you though; so I should state that there are various options that are available with docker-compose that are not available with docker stack deploy. Often times you can't just use the same compose file as you're using in development.

AWS ECS repository creation with EC2

Hello,
I have a running EC2 with applications installed and I want to migrate the app onto Docker container.So, can we create an ECS Docker repository using running EC2 instance?
The biggest thing in your question is dockerizing your apps.The complexity varies as per technologies used in app, app server as docker image and many other things comes into picture.Its not direct conversion and you need to do lot of work to convert apps as docker images depends app comlexity.
ECR is docker registry where you store docker images and you don't need ec2 instance for that.
Once you docker images and ECR, you need to create ECS cluster to run your apps docker containers.

How to tailor rest service with docker tomcat in AWS Elastic Beanstalk

Hi I am new to docker and am trying to understand how to deploy rest service in tomcat using docker container in AWS.
Basically, any rest service requires a server so I am able to deploy my war file in the tomcat app folder which is installed in an EC2 instance.
But when I go for EB applications with docker it wants me to provide a docker zip file( obviously containing the dockerfile in it). So my dockerfile should specify that i am using openjdk, then should install tomcat and setup environment variables. This part i understood.
Next transfer the war file to this tomcat location in docker.
I am stuck here how should i do this. Should i copy the war file in the docker image export ? Or is there a way to avoid this? I am looking for a way that i can build the source file using maven and deploy it to Elastic beanstalk with docker and tomcat.
Please excuse me for this confusing question and dumbness but I have read a lot of articles and I am completely confused so asking for help here.

Recommendation: Deploy Docker application to AWS

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.

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.