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

ひたすら楽して、PHPアプリをコンテナ運用の縮小版

NIIKURA Ryota
November 06, 2017

 ひたすら楽して、PHPアプリをコンテナ運用の縮小版

PHPカンファレンス関西でやったやつの縮小版です

NIIKURA Ryota

November 06, 2017
Tweet

More Decks by NIIKURA Ryota

Other Decks in Technology

Transcript

  1. ͻͨ͢Βָͯ͠ɺ1)1
    ΞϓϦΛίϯςφӡ༻
    OJJTBOUPLZP
    ॖখ൛

    View Slide

  2. OJJTBOUPLZP
    w ΤϯδχΞྺ೥͘Β͍
    w ΤϯδχΞྺ1)1FSྺ
    w झຯ͸ήʔϜͱɺϓϩάϥϜ

    Ͱ༡Ϳ͜ͱ͘Β͍

    14ͱਓʹݴ͑ͳ͍ιγϟή
    w ϓϩάϥϜΛॻ͍͍ͯΔͱػݏ͕ྑ͘ͳΔ
    w ภ৯
    w ݩ޻ࣄ԰

    View Slide

  3. ͜Εͷॖখ൛
    IUUQTTQFBLFSEFDLDPNOJJTBOUPLZPIJUBTVSBMF
    TJUFQIQBQVSJXPLPOUFOBZVOZPOH

    View Slide

  4. ࠷ۙɺίϯςφͷ͜ͱ
    ͔͠ݴͬͯͳ͍

    View Slide

  5. ίϯςφ࢖ͬͯ΄ͯ͘͠ॻ͍ͨهࣄ

    View Slide

  6. ։ൃ؀ڥ͸Կ࢖ͬͯ·͔͢ʁ
    εςʔδϯά؀ڥ͸Կ࢖ͬͯ·͔͢ʁ
    ίϯςφ
    QIQඞཁͳΤΫεςϯγϣϯ

    ίϯςφ
    QIQඞཁͳΤΫεςϯγϣϯಈ࡞ίʔυ

    View Slide

  7. ຊ൪؀ڥ͸Կ࢖ͬͯ·͔͢ʁ
    Ͱ͸$*؀ڥ͸Կ࢖ͬͯ·͔͢ʁ
    ίϯςφ
    QIQඞཁͳΤΫεςϯγϣϯಈ࡞ίʔυ

    ίϯςφ
    JO(JU-BC$*

    View Slide

  8. ςετ͢Δͱ͖͸ɻɻɻ
    ίϯςφ
    NZTRM΍SFEJTͱ͔पล؀ڥ΋༻ҙͯ͠Δ

    ίϯςφΠϝʔδ࡞Δͱ͖΋ɻɻɻ
    ίϯςφ
    EPDLFSJOEPDLFS

    View Slide

  9. ίϯςφӡ༻͸
    ָͳͷ͔ʁ

    View Slide

  10. ӡ༻ʹؔΘΔλεΫϦετ
    w ίʔυΛॻ͘
    w (JUͰϓογϡ͢Δ
    w ίʔυ͔Βಈ࡞؀ڥͷίϯ
    ςφΠϝʔδΛϏϧυ͢Δ
    w ίϯςφΠϝʔδΛϨδε
    τϦʹϓογϡ
    w ΞϓϦέʔγϣϯͱͯ͠ಈ
    ࡞͢ΔΑ͏ɺίϯςφΛαʔ
    ό্ʹ഑ஔ
    w ϩʔυόϥϯαͱίϯς
    φΛͭͳ͛Δ
    w ίϯςφͷࢮ׆؂ࢹΛߦ
    ͏
    w ίϯςφ͕ࢮΜͰ͍ͨΒ৽
    ͘͠ίϯςφΛىಈ͢Δ
    w ෛՙ͕େ͖͘ͳͬͨΒε
    έʔϧΞ΢τɺෛՙ͕ݮগ
    ͨ͠Βεέʔϧμ΢ϯ

    View Slide

  11. Ϡόͦ͏ͳͷͰπʔϧ࢖͏
    w LVCFSOFUFT

    ˠσϑΝΫτͬΆ͍͚ͲɺΠϯϑϥऑ͍ͷͱ֓೦͕Θ͔Βͳ
    ͔ͬͨͷͰอཹ
    w (,&

    ˠ($1ͷίϯςφӡ༻αʔϏεͰLVCFSOFUFT४ڌ͕ͩͬͨɺ΍ͬ
    ͺΓ֓೦͕Θ͔Βͳ͍ͷͱɺ($1࢖ͬͨ͜ͱͳ͔ͬͨͷͰɺ
    ΍ͬͺΓอཹ
    w &$4

    ˠ"84ͷίϯςφӡ༻αʔϏεɻ%#ͱ͔΋"84ʹͷͤΔͷͰɺ
    ͔͔ͤͬͩ͘Β
    ࠾༻

    View Slide

  12. &$4

    View Slide

  13. /HJOY
    QIQ
    GQN
    ίϯςφΠϯελϯε &$

    /HJOY
    QIQ
    GQN
    λεΫ
    Ϋϥελʔ
    "-#
    UBSHFU
    HSPVQ
    αʔϏε
    &$3
    ";

    View Slide

  14. /HJOY
    QIQ
    GQN
    ίϯςφΠϯελϯε &$

    /HJOY
    QIQ
    GQN
    λεΫ
    Ϋϥελʔ
    "-#
    UBSHFU
    HSPVQ
    αʔϏε
    &$3
    ";
    QIQ
    GQN
    QIQ
    GQN
    جຊతʹݟΔͷ͸͚ͩ͜͜

    View Slide

  15. ӡ༻ʹؔΘΔλεΫϦετ
    w ίʔυΛॻ͘
    w (JUͰϓογϡ͢Δ
    w ίʔυ͔Βಈ࡞؀ڥΛίϯ
    ςφΠϝʔδΛϏϧυ͢Δ
    w ίϯςφΠϝʔδΛϨδε
    τϦʹϓογϡ
    w ΞϓϦέʔγϣϯͱͯ͠ಈ
    ࡞͢ΔΑ͏ɺίϯςφΛαʔ
    ό্ʹ഑ஔ
    w ϩʔυόϥϯαͱίϯς
    φΛͭͳ͛Δ
    w ίϯςφͷࢮ׆؂ࢹΛߦ
    ͏
    w ίϯςφ͕ࢮΜͰ͍ͨΒ৽
    ͘͠ίϯςφΛىಈ͢Δ
    w ෛՙ͕େ͖͘ͳͬͨΒε
    έʔϧΞ΢τɺෛՙ͕ݮগ
    ͨ͠Βεέʔϧμ΢ϯ

    View Slide

  16. ΋͏ͪΐָ͍Λ͍ͨ͠
    $*Λ࢖͏

    View Slide

  17. (JU-BC$*
    w (JU-BCʹ૊Έࠐ·Εͨ$*
    w ίϯςφϕʔεͰ࡞ۀͰ͖Δ
    w ϨδετϦ΋͋Δ &$4Ͱ͸׆༻Ͱ͖ͳ͔ͬͨ

    w 4BB4൛͸ͨ·ʹ΍Β͔͢

    IUUQTBCPVUHJUMBCDPNHJUMBC
    EPUDPNEBUBCBTFJODJEFOU

    View Slide

  18. NBTUFSQVTI
    PSNFSHF
    UBHQVTI
    &$3
    ։ൃ؀ڥ
    λεΫ
    ։ൃ؀ڥαʔ
    Ϗε
    ຊ൪؀ڥ
    λεΫ
    ຊ൪؀ڥαʔ
    Ϗε
    $*
    ΠϝʔδϏϧυ
    ϓογϡ
    λεΫߋ৽
    αʔϏεߋ৽
    λεΫߋ৽
    αʔϏεߋ৽

    View Slide

  19. ӡ༻ʹؔΘΔλεΫϦετ
    w ίʔυΛॻ͘
    w (JUͰϓογϡ͢Δ
    w ίʔυ͔Βಈ࡞؀ڥΛίϯ
    ςφΠϝʔδΛϏϧυ͢Δ
    w ίϯςφΠϝʔδΛϨδε
    τϦʹϓογϡ
    w ΞϓϦέʔγϣϯͱͯ͠ಈ
    ࡞͢ΔΑ͏ɺίϯςφΛαʔ
    ό্ʹ഑ஔ
    w ϩʔυόϥϯαͱίϯς
    φΛͭͳ͛Δ
    w ίϯςφͷࢮ׆؂ࢹΛߦ
    ͏
    w ίϯςφ͕ࢮΜͰ͍ͨΒ৽
    ͘͠ίϯςφΛىಈ͢Δ
    w ෛՙ͕େ͖͘ͳͬͨΒε
    έʔϧΞ΢τɺෛՙ͕ݮগ
    ͨ͠Βεέʔϧμ΢ϯ

    View Slide

  20. ·ͱΊ
    w ։ൃ΋ӡ༻΋ίϯςφͰ΍ͬͯΔ
    w ίϯςφӡ༻͸ੜͰ΍Δͱେม͚ͩͲɺπʔϧ΍αʔ
    ϏεΛ࢖͏ͱָʹͳΔ
    w $*ͱ͔࢖͏ͱΠϝʔδϏϧυ͔ΒࣗಈԽͰ͖Δͷ
    Ͱɺ΋ͬͱָʹͳΔ͔΋

    View Slide