Google App Engine

From XennisWiki
Jump to: navigation, search

Google App Engine (often referred to as GAE or simply App Engine) is a web framework and cloud computing platform for developing and hosting web applications in Google-managed data centers. Applications are sandboxed and run across multiple servers. App Engine offers automatic scaling for web applications—as the number of requests increases for an application, App Engine automatically allocates more resources for the web application to handle the additional demand. (Wikipedia)

Usage

Deploy an example app

git clone -b phase0-helloworld https://github.com/GoogleCloudPlatform/appengine-php-guestbook
cd appengine-php-guestbook
gcloud app create
gcloud app deploy

Open the outputted link.

Flex custom environment (example)

Examples: Google App Engine Custom Runtime Samples

Set the runtime in the app.yml to custom

runtime: custom
env: flex

runtime_config:
  document_root: w

beta_settings:
  cloud_sql_instances: <project>:<region>:<instance>

Put a Dockerfile next to the app.yml

FROM gcr.io/google-appengine/php
#RUN apt-get update && \
#    apt-get install imagemagick -y

ENV DOCUMENT_ROOT /app/w
WORKDIR $APP_DIR
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]

Deploy the app

gcloud app deploy

Tips

Ignore files

Add the files or directories to ignore into the .gcloudignore. The syntax is the same like for Git - Ignore. Example:

.gcloudignore
.git
.gitignore

See also

External links