$30 off During Our Annual Pro Sale. View Details »

開発環境をどっかんどっかん立てる

Konboi
March 07, 2015

 開発環境をどっかんどっかん立てる

若手Webエンジニア交流会 #9 の発表資料です

Konboi

March 07, 2015
Tweet

More Decks by Konboi

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ • @Konboi • ໘ന๏ਓKAYAC • ೖࣾ 3೥໨ • ࣗࣾαʔϏε

    → डୗνʔϜ → ήʔϜ։ൃ/ӡ༻ • ޷͖ͳ΋ͷ: ! " • ೰Έ: ݁ࠗࣜͷ2࣍ձͷग़͠෺ͱ͔ͰἤΒΕΔ
  2. • A͞Μ < devAA ࢖ͬͯ·͔͢ʁ • B͞Μ < ͋Ŋࠓ࢖ͬͯΔ͔Β devBB

    ࢖ͬͯ΋Β͑Δʁ • C͞Μ < ࠓ devBB ࣗ෼͕࢖ͬͯΔʂ • A͞Μ < ɾɾɾ (´ɾωɾʆ)
  3. # config.yml host: webapi: docker.wakateweb.konboi.com reverse_proxy_suffix: .wakateweb.konboi.com listen: foreign_address: 127.0.0.1

    http: - listen: 5580 target: 4567 docker: endpoint: unix:///var/run/docker.sock default_image: "wakateweb:latest"
  4. nginx.conf upstream backend_docker { server 127.0.0.1:5580; } server { listen

    80; server_name *.wakateweb.konboi.com; access_log /var/log/nginx/access.docker.log ltsv; error_log /var/log/nginx/error.docker.log error; location / { proxy_pass http://backend_docker; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
  5. ϙΠϯτ • go get ͰΠϯετʔϧ͕Φεεϝ • ϦϦʔεύοέʔδΛ࢖͏৔߹͸leveldͷΠϯετʔϧ • dockerίϯςφ΋͋Γ·͢ •

    DB͸ผίϯςφ͔RDS౳Λར༻͢Δͷ͕Φεεϝ • ίϯςφ಺ʹ࡞Δͱ࡟আͷࡍʹDBσʔλ΋໪࿦࡟আ • rackup͸listen port ͕ localhostͳͷͰϋϚΓ·͢
  6. ·ͱΊ • docker × mirageΛ࢖ͬͯշదͳ؀ڥߏஙΛ • ίϐϖͷΑ͏ͳ.confϑΝΠϧ͕ྔ࢈͞Εͳ͍ • Rest/Webܦ༝ͰߏஙͰ͖ΔͷͰ୭Ͱ΋؀ڥߏஙՄೳʹ •

    ؀ڥΛୣ͍߹ΘͣʹࡁΈνʔϜͷงғؾ͕ྑ͘ͳΓ·ͨ͠ʂ • ͪΌΜͱνΣοΫͰ͖ΔͷͰόά̌ʂ ࠷ߴͩʂʂ