50
Using Docker and Elastic Beanstalk in Production Taking the leap from the Monolithic application to service oriented architecture.

Using Docker and Elastic Beanstalk in Production

Embed Size (px)

Citation preview

Page 1: Using Docker and Elastic Beanstalk in Production

Using Docker and Elastic Beanstalk in ProductionTaking the leap from the Monolithic application to service oriented architecture.

Page 2: Using Docker and Elastic Beanstalk in Production

Quick Survey!

Page 3: Using Docker and Elastic Beanstalk in Production
Page 4: Using Docker and Elastic Beanstalk in Production
Page 5: Using Docker and Elastic Beanstalk in Production
Page 6: Using Docker and Elastic Beanstalk in Production
Page 7: Using Docker and Elastic Beanstalk in Production

PIVOT TIME!2006

Social Network for reviewing businesses!

Page 8: Using Docker and Elastic Beanstalk in Production
Page 9: Using Docker and Elastic Beanstalk in Production
Page 10: Using Docker and Elastic Beanstalk in Production
Page 11: Using Docker and Elastic Beanstalk in Production

We Sucked!

Page 12: Using Docker and Elastic Beanstalk in Production
Page 13: Using Docker and Elastic Beanstalk in Production

Time to Pivot!2011

Page 14: Using Docker and Elastic Beanstalk in Production
Page 15: Using Docker and Elastic Beanstalk in Production
Page 16: Using Docker and Elastic Beanstalk in Production
Page 17: Using Docker and Elastic Beanstalk in Production
Page 18: Using Docker and Elastic Beanstalk in Production
Page 19: Using Docker and Elastic Beanstalk in Production
Page 20: Using Docker and Elastic Beanstalk in Production

Business is good. But we’ve got Tech Debt!

Page 21: Using Docker and Elastic Beanstalk in Production
Page 22: Using Docker and Elastic Beanstalk in Production
Page 23: Using Docker and Elastic Beanstalk in Production

EC2

MYSQL MYSQL MYSQL

RDS

Page 24: Using Docker and Elastic Beanstalk in Production
Page 25: Using Docker and Elastic Beanstalk in Production

SOA

Monolithic ArchitectureService Oriented Architecture

Page 26: Using Docker and Elastic Beanstalk in Production
Page 27: Using Docker and Elastic Beanstalk in Production
Page 29: Using Docker and Elastic Beanstalk in Production

Pets vs Cattle

VS

Pets:- Server typically on site, own and maintain- Server tied to App- Named (universe, saturn, pluto)

Cattle:- Improved Resource utilization- Typically off site- Vendor Maintained- Problems? Just delete.- Done? Delete

Page 30: Using Docker and Elastic Beanstalk in Production

Pets vs Cattle

VS

Cattle:- VMs are “Heavyweight”- Images are hard to upload- Not Portable- Typically “Long Lived”

Bacteria:- Lightweight (can be just one process)- A process isolator- Alive for minutes

Page 31: Using Docker and Elastic Beanstalk in Production

So why use Docker?reproducibility

Page 32: Using Docker and Elastic Beanstalk in Production

What Is Docker?

Page 33: Using Docker and Elastic Beanstalk in Production
Page 34: Using Docker and Elastic Beanstalk in Production
Page 35: Using Docker and Elastic Beanstalk in Production
Page 36: Using Docker and Elastic Beanstalk in Production

Docker containers

Docker containers are similar to a

directory. A Docker container holds

everything that is needed for an

application to run. Each container is

created from a Docker image. Docker

containers can be run, started, stopped,

moved, and deleted. Each container is an

isolated and secure application platform.

Docker containers are the runcomponent

of Docker.

Docker images

A Docker image is a read-only template.

For example, an image could contain an

Ubuntu operating system with Apache

and your web application installed.

Images are used to create Docker

containers. Docker provides a simple way

to build new images or update existing

images, or you can download Docker

images that other people have already

created. Docker images are the build

component of Docker.

BUILD RUN

Page 37: Using Docker and Elastic Beanstalk in Production

Docker Files

Page 38: Using Docker and Elastic Beanstalk in Production
Page 41: Using Docker and Elastic Beanstalk in Production

Docker Hub to Elastic Beanstalk credentials on S3

Page 42: Using Docker and Elastic Beanstalk in Production

Configuring and launching to Elastic Beanstalk.

Page 43: Using Docker and Elastic Beanstalk in Production

Health Checks should check your application, not Nginx

Page 44: Using Docker and Elastic Beanstalk in Production

Remember Nginx is in front of your container on EB

Page 45: Using Docker and Elastic Beanstalk in Production

Node.js Specific Notes For Production

Supervisor Conf

[supervisord]

nodaemon=true

[program:grunt]

command=grunt

autorestart=true

Dockerfile

#Install Supervisor

RUN apt-get install -y supervisor

RUN mkdir -p /var/log/supervisor

COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

#Switch to the container local version of the application

WORKDIR /usr/src/app

#TEll docker what port to look at for your app

EXPOSE 5000

#Start the Application

CMD ["/usr/bin/supervisord"]

Page 46: Using Docker and Elastic Beanstalk in Production

Application monitoring, Needs to be external

Page 49: Using Docker and Elastic Beanstalk in Production
Page 50: Using Docker and Elastic Beanstalk in Production