Slide 1

Slide 1 text

SymfonyΞϓϦΛ HerokuʹσϓϩΠ͢Δ #symfony_meetup 2015.04.26 @qckanemoto

Slide 2

Slide 2 text

• ໊ݹ԰͔Βདྷ·ͨ͠ • (ג)ΧϧςοτίϛϡχέʔγϣϯζCTO • PHPྺ3೥ • Symfonyྺ1೥ʢ൒೥͙Β͍͸ROMઐʣ @qckanemoto

Slide 3

Slide 3 text

Χϧςοτίϛϡχέʔγϣϯζ • PHPerืूதʂ • ໊ݹ԰ʢϦϞʔτՄʣ • @hidenorigoto͞Μ͕஥ؒೖΓ͠·ͨ͠ • ϦεςΟϯά޿ࠂӡ༻πʔϧʮLisketʯ

Slide 4

Slide 4 text

ΤϯδχΞͷಇ͖΍͢͞௒େࣄʹͯ͠·͢ Χϧςοτίϛϡχέʔγϣϯζ

Slide 5

Slide 5 text

SNS͔ϝʔϧͰ͓ؾܰʹ͝࿈བྷ͍ͩ͘͞✨ Χϧςοτίϛϡχέʔγϣϯζ

Slide 6

Slide 6 text

ຊ୊

Slide 7

Slide 7 text

SymfonyΞϓϦΛHerokuͰ ಈ͔ͨ͜͠ͱ͋Δਓʁ

Slide 8

Slide 8 text

͸͍ɺ୭΋͍·ͤΜͶ Ͱ͸આ໌͠·͠ΐ͏✋

Slide 9

Slide 9 text

Herokuͱ͸ • ΁Ζ͘ • ແྉ͔Β࢖͑ΔPaaS • ΞΫηεͷগͳ͍਎಺༻ͷΞϓϦͱ͔ͳΒ
 ࣗ෼Ͱαʔό༻ҙͤͣHerokuͰશવOK

Slide 10

Slide 10 text

ΞϓϦΛಈ͔͢·ͰͷྲྀΕ 1. HerokuΞΧ΢ϯτΛ࡞੒ 2. heroku-toolbeltΛΠϯετʔϧ 3. Heroku্ʹΞϓϦΛ࡞੒ 4. Heroku؀ڥΛSymfony޲͚ʹখࡉ޻ 5. σϓϩΠ

Slide 11

Slide 11 text

HerokuΞΧ΢ϯτΛ࡞੒

Slide 12

Slide 12 text

࡞੒͍ͯͩ͘͠͞স

Slide 13

Slide 13 text

heroku-toolbelt ΛΠϯετʔϧ

Slide 14

Slide 14 text

heroku-toolbelt • CLI͔ΒherokuΛૢ࡞͢ΔͨΊʹඞཁ • herokuίϚϯυ͕Πϯετʔϧ͞ΕΔ • جຊతʹherokuίϚϯυͰ͍Ζ͍Ζ΍Δ

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

$ brew cask install heroku-toolbelt ·ͨ͸

Slide 17

Slide 17 text

Heroku্ʹΞϓϦΛ࡞੒

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

ϩʔΧϧͱHerokuΞϓϦΛඥ෇͚

Slide 20

Slide 20 text

Heroku؀ڥΛ Symfony޲͚ʹখࡉ޻

Slide 21

Slide 21 text

ඞཁͳখࡉ޻ • SYMFONY_ENV؀ڥม਺Λprodʹઃఆ • LESSΛ࢖͏ͨΊʹcomposer installͷલʹ npm install͕࣮ߦ͞ΕΔΑ͏ʹઃఆ • σϓϩΠޙʹassetic:dumpͤ͞ΔΑ͏ઃఆ • Heroku༻ͷىಈεΫϦϓτΛ༻ҙ

Slide 22

Slide 22 text

SYMFONY_ENV؀ڥม਺ • HerokuʹPHPΞϓϦΛσϓϩΠ͢ΔͱࣗಈͰ composer install —no-dev ͕࣮ߦ͞ΕΔ • require-devͳϥΠϒϥϦ͕Πϯετʔϧ͞Εͳ͍ • dev؀ڥͰಈ͔͢ͱΤϥʔʹͳΔ • SYMFONY_ENV=prodΛઃఆ͓ͯ͘͠

Slide 23

Slide 23 text

SYMFONY_ENV؀ڥม਺

Slide 24

Slide 24 text

ϓϩδΣΫτ಺ʹLESSΛೖΕΔ • globalͳnode_modulesΛ࢖͍ͬͯΔ৔߹͸ɺ
 ϓϩδΣΫτϩʔΧϧͳnode_modulesΛ
 ࢖͑ΔΑ͏ʹ͓ͯ͘͜͠ͱ͕લఏ

Slide 25

Slide 25 text

ϓϩδΣΫτ಺ʹLESSΛೖΕΔ

Slide 26

Slide 26 text

• Heroku͸σϓϩΠ͞ΕͨιʔεΛݟͯࣗಈͰ ؀ڥΛબΜͰηοτΞοϓͯ͘͠ΕΔ • index.php͕͋Ε͹PHP༻ͷ؀ڥ • →composer install͕ࣗಈͰ࣮ߦ͞ΕΔ • PHP༻ͷ؀ڥʹ͸node͕ೖͬͯͳ͍ • →npm install΋࣮ߦ͞Εͳ͍ npm installͰ͖Δ؀ڥʹ͢Δ

Slide 27

Slide 27 text

• heroku-buildpack-multiΛ࢖͏ • ෳ਺ͷ؀ڥΛࢦఆͯ͠ϋΠϒϦουʹ࢖͑Δ npm installͰ͖Δ؀ڥʹ͢Δ

Slide 28

Slide 28 text

assetic:dumpͤ͞Δ • HerokuͰ͸composer.jsonܦ༝Ͱࣗ༝ʹεΫ ϦϓτΛ࣮ߦͰ͖Δ

Slide 29

Slide 29 text

Heroku༻ىಈεΫϦϓτΛ༻ҙ • Procfile • composer.jsonͰbin-dirΛbinʹ͍ͯ͠Δ৔߹ ͸ҎԼͷͱ͓Γ

Slide 30

Slide 30 text

σϓϩΠ

Slide 31

Slide 31 text

git push͢Δ͚ͩ

Slide 32

Slide 32 text

·ͱΊ

Slide 33

Slide 33 text

·ͱΊ • SymfonyΞϓϦΛHerokuͰಈ͔͢ͷʹඞཁͳ खॱΛ·ͱΊ·ͨ͠ • ϒϩάʹ΋͏গ͠ৄ͘͠ॻ͍ͯ͋Γ·͢ • http://tech.quartetcom.co.jp/2015/03/20/ symfony2-heroku/

Slide 34

Slide 34 text

Thanks ;)