Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Docker ApplicationをDaaSにデプロイ #dockerjp

Docker ApplicationをDaaSにデプロイ #dockerjp

at Docker meetup Tokyo #2

taichi nakashima

April 11, 2014
Tweet

More Decks by taichi nakashima

Other Decks in Technology

Transcript

  1. DaaS Rails Application Λ Docker ίϯςφʹͷͤͯ Docker as a Service

    (DaaS) ʹσϓϩΠ͢Δ https://orchardup.com/ DaaS https://orchardup.com/ https://orchardup.com/
  2. DaaS Rails Application Λ Docker ίϯςφʹͷͤͯ Docker as a Service

    (DaaS) ʹσϓϩΠ͢Δ https://orchardup.com/ DaaS https://stackdock.com/
  3. DaaS Rails Application Λ Docker ίϯςφʹͷͤͯ Docker as a Service

    (DaaS) ʹσϓϩΠ͢Δ https://orchardup.com/ DaaS http://www.tutum.co/
  4. Dockerfile (Rails) $ gem install rbdock $ rbdock 2.0.0-p247 --app

    todo-rails4-angularjs https://github.com/tcnksm/rbdock
  5. development: adapter: postgresql template: template0 encoding: unicode database: todo_rails4_angularjs_development pool:

    5 username: docker password: docker host: <%= ENV.fetch('DB_PORT_5432_TCP_ADDR') %> port: <%= ENV.fetch('DB_PORT_5432_TCP_PORT') %> http://deeeet.com/writing/2014/03/20/docker-link-container/ config/database.yml
  6. $ docker run -d -p 5432:5432 \ -e POSTGRESQL_USER=docker \

    -e POSTGRESQL_PASS=docker \ -name pg \ orchardup/postgresql Postgresql Container
  7. $ docker run -d -p 5432:5432 \ -e POSTGRESQL_USER=docker \

    -e POSTGRESQL_PASS=docker \ -name pg \ orchardup/postgresql Rails Container $ docker run -i t —p 3000:3000 \ -link pg:db \ tcnksm/rails \ 'rake db:create && rake db:migrate && rails server'
  8. Development at local • มߋ͕ೖͬͨΒ build && run (+Guard) •

    VolumesػೳΛ࢖͑͹ϦΞϧλΠϜߋ৽ (+ ONBUILD)
  9. Docker Share (ngrok) $ orchard hosts create Orchard username: tcnksm

    Password: Default host running at 162.243.106.93 $ ngrok 3000 http://36a98c94.ngrok.com -> 127.0.0.1:3000
  10. Login to Orchard $ orchard hosts create Orchard username: tcnksm

    Password: Default host running at 162.243.106.93
  11. $ orchard docker run -d -p 5432:5432 \ -e POSTGRESQL_USER=docker

    \ -e POSTGRESQL_PASS=docker \ -name pg \ orchardup/postgresql Postgresql Container
  12. $ docker run -d -p 5432:5432 \ -e POSTGRESQL_USER=docker \

    -e POSTGRESQL_PASS=docker \ -name pg \ orchardup/postgresql Rails Container $ orchard docker run -i t —p 80:3000 \ -link pg:db \ tcnksm/rails \ 'rake db:create && rake db:migrate && rails server'