Click here to load reader
View
603
Download
2
Embed Size (px)
AWS
Docker with
Elastic Beanstalk
Team Leader, Parking Square Inc.
AWS
AWS
ParkHere
25
15
10 MAU
AWS
EC2
RDS MariaDB
ElasticCache Redis
AWS SNS
AWS S3
Elastic Load Balancer
Rails 4
AWS
Elastic Beanstalk
(EC2, ELB )
eb jar
AWS
https://ap-northeast-
1.console.aws.amazon.com/elasticbeanst
alk/home
CLI
brew install aws-elasticbeanstalk
Docker
brew install docker docker-machine
AWS
CLI
git branch
eb init
eb create
eb config
eb deploy
eb --help
AWS
Dockerfile
FROM ruby:2.2.3
MAINTAINER stadia([email protected])
RUN apt-get -y autoremove && apt-get update && apt-get -y dist-upgrade && rm -rf /var/lib/apt/lists/*
ENV RAILS_VERSION 4.2.4
RUN gem install rails --version "$RAILS_VERSION
RUN gem install thin tzinfo-data
RUN echo Asia/Seoul > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata
WORKDIR /app
ADD Gemfile /app/Gemfile
RUN bundle install
ENV RAILS_ENV production
EXPOSE 3000CMD ["rails", "server", "-b", "0.0.0.0"]
mailto:[email protected])
AWS
Dockerrun.aws.json
,
{
"AWSEBDockerrunVersion": "1",
"Authentication": {
"Bucket": "docker-parkhere,
"Key": "config/dockercfg},
"Image": {Name:stadia/taekwon, Update: true},
"Ports": [{"ContainerPort": "3000}],
"Volumes": [
{"HostDirectory": "/home/ec2-user/api/app,"ContainerDirectory": "/app/app},
{"HostDirectory": "/home/ec2-user/log,"ContainerDirectory": "/app/log}
],
"Logging": "/var/log/nginx
}
AWS
1. hub.docker.com
push
2. Dockerrun.aws.json image
deploy Dockerfile
AWS
.
nginx
proxy
AWS
ECS
.
ex) ec2
nginx, , db
AWS
THANK YOU