Basic tutorial for flexible environment of Google App Engine


This article shows basic tutorial for flexible environment of Google App Engine(GAE) on Google Computing Platform(GCP).

🎳 Advanced Preparation

Download and install Google Cloud SDK:

https://cloud.google.com/sdk/docs/

# 初期化
gcloud init

gcloud components install docker-credential-gcr
# which gcloud and find "bin/docker-credential-gcr" from the path
# Set shortcuts like / usr / local / bin with ln -s to .zshrc or .bashrc

gcloud auth configure-docker

# logging into GCR
docker-credential-gcr gcr-login

# set configuration to Docker
docker-credential-gcr configure-docker

😸 Quick Start

Create Dockerfile

Create Dockerfile with listing port 8080.

Create app.yml

Create gcloud-app.yml.

runtime: custom
env: flex
service: SAMPLE_APP_NAME
enable_health_check: False

manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10

More Detail:

Deploy the app

# build docker image
docker build -t sample-app:latest -f docker/Dockerfile .

# set tag
docker tag sample-app:latest asia.gcr.io/gcp-project-sample/sample-app:latest

# push image
docker push asia.gcr.io/gcp-project-sample/sample-app:latest

# deploy to feature-2 env
gcloud app deploy gcloud-app.yml --image-url=asia.gcr.io/dr-chopper-development-in/dr-chopper-frontend:feature-2 --project=gcp-project-sample

Browse the app

gcloud app browse

🎃 References

🖥 Recommended VPS Service

VULTR provides high performance cloud compute environment for you. Vultr has 15 data-centers strategically placed around the globe, you can use a VPS with 512 MB memory for just $ 2.5 / month ($ 0.004 / hour). In addition, Vultr is up to 4 times faster than the competition, so please check it => Check Benchmark Results!!