Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
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 ;)