Created: 2016-08-23 Tue 17:04
https://github.com/zakame/docker-eb-demo
eb swap
, ELB)See github above ;)
dig +short cats.zakame.org.
zakame-cats-prod.us-east-1.elasticbeanstalk.com. 54.225.221.170 50.17.210.230
use Plack::Builder; my @images = <DATA>; # Its dangerous, take a cat with you! builder { mount '/' => builder { enable 'TMT', include_path => 'tmpl', macro => +{ url => sub { $images[int rand @images] }, }; }; }; __DATA__ http://ak-hdl.buzzfed.com/static/2013-10/enhanced/webdr05/15/9/anigif_enhanced-buzz-26388-1381844103-11.gif http://ak-hdl.buzzfed.com/static/2013-10/enhanced/webdr01/15/9/anigif_enhanced-buzz-31540-1381844535-8.gif http://ak-hdl.buzzfed.com/static/2013-10/enhanced/webdr05/15/9/anigif_enhanced-buzz-26390-1381844163-18.gif
# our base image FROM perl:5.24.0 # install Carton RUN cpanm Carton # install CPAN modules needed by the Perl app COPY cpanfile* /usr/src/app/ WORKDIR /usr/src/app RUN carton install --deployment # copy files required for the app to run COPY app.psgi /usr/src/app COPY tmpl/index /usr/src/app/tmpl/ # tell the port number the container should expose EXPOSE 5000 # run the application CMD ["carton", "exec", "plackup", "app.psgi"]
pip install awsebcli
eb init eb create --cname zakame-cats-live blue
eb status blue
Environment details for: blue Application name: docker-eb-demo Region: us-east-1 Deployed Version: app-160823_160301 Environment ID: e-qmphs33nch Platform: 64bit Amazon Linux 2016.03 v2.1.3 running Docker 1.11.1 Tier: WebServer-Standard CNAME: zakame-cats-prod.us-east-1.elasticbeanstalk.com Updated: 2016-08-23 08:15:08.455000+00:00 Status: Ready Health: Green
eb ssh blue
eb clone --cname zakame-cats-test blue --clone_name green
eb status green
eb swap
AWSElasticBeanstalkFullAccess
policy on IAM User when trying out
(don't do on prod though! http://stackoverflow.com/questions/31977441/aws-elastic-beanstalk-servicerole-error-when-logging-in-to-a-role