PHP7+Laravel5.3 on Google App Engine

PHP7+Laravel5.3 on Google App Engine

PHP7+Laravel5.3 on Google App Engine
Using Google app Engine Flexible Environment

C98c481072520f41fed66ddd1b538cb5?s=128

Takumi Yoshida

December 09, 2016
Tweet

Transcript

  1. PHP7+Laravel5.3 on Google App Engine y.takky2014

  2. Google App Engine is… • Paas • Language: Python, Java7,

    PHP, Go • Auto Scaling • CloudSQL,BigData ….
  3. • “App Engine runs your PHP web application using a

    PHP 5.5.34 interpreter” PHP Version IUUQTDMPVEHPPHMFDPNBQQFOHJOFEPDTQIQSVOUJNF
  4. Laravel5.3 “However, if you are not using Homestead, you will

    need to make sure your server meets the following requirements: PHP >= 5.6.4 OpenSSL PHP Extension PDO PHP Extension Mbstring PHP Extension Tokenizer PHP Extension XML PHP Extension “ IUUQTMBSBWFMDPNEPDT
  5. App Engine flexible environment • Google Compute Engine ϕʔε •

    Auto Scaling • ࣮ߦ؀ڥͷఆ͕ٛͰ͖Δ • Docker Base
  6. Step0. ४උ • Project࡞੒ • https://console.cloud.google.com/appengine? src=ac • Cloud SdkΠϯετʔϧ

    • https://cloud.google.com/sdk/ • gcloud init • ࣗ෼ͷΞΧ΢ϯτ/projectͰೝূ͓ͯ͘͠
  7. Step1. Laravel5.3ͷ४උ • https://github.com/laravel/laravel/releases • 5.3.16ΛDLͯ͠ద౰ͳσΟϨΫτϦʹҠಈ • ࠓճ͸ ~/laravel5.3_on_appengine/appԼʹ Ҡಈ

    • local͕php7Ͱ͋Ε͹composer updateͱenv ४උ΋͓ͯ͘͠
  8. Step2 make docker file • Dockerhubʹ͋ΔPHP7+ApacheΛ࢖༻ • https://hub.docker.com/_/php/ • apacheͷઃఆϑΝΠϧͱLaravel5.3Λ


    ADD͢Δ
  9. Step3. make app.yaml • https://cloud.google.com/appengine/docs/ flexible/custom-runtimes/quickstart • ͦΜͳʹॻ͘͜ͱ͸ͳ͍

  10. Step4. gcloud app deploy • gcloud app deploy • GAE্ʹσϓϩΠͰ͖Δ

    • Dockerfile͔Βbuildͯ͠ʙͬͯײ͡ͳͷͰ ͔ͳΓ͔͔࣌ؒΔ
  11. gcloud app browse • σϑΥϧτͷϒϥ΢βͰ։͚Δ

  12. Weak point • App engineʹൺ΂ͯߴ͍ 
 1ϲ݄Ͱ໿5000ԁ͙Β͍ • App engineͱ͍͍࣮࣭ͭͭCompute

    Engine • ComputeEngineͷํ͕͍҆ • ෛՙߟ͑ͳ͚Ε͹n1-standard/ Preemptible Ͱ
 $8ҎԼ?
  13. Conclusion • GKE΄Ͳ೉͘͠ͳ͘DockerΛ࢖͑Δɻͱ͍͏ ఺͸͍͍ • ࠓճ࡞ͬͨ΋ͷ͸ҎԼ • https://github.com/ytakky2014/ laravel5.3_on_appengine