Configuring your App with app.yaml

A Java app in App Engine is configured using an app.yaml file, that contains CPU, memory, network and disk resources, scaling, and other general settings including environment variables.

You can select the Eclipse Jetty 9.3 Runtime or the Java 8 Runtime. Using Maven or Gradle makes this easier.

About app.yaml files

Specify all the runtime configuration for your Java app, including versions and URLs, in the app.yaml file. This file acts as a deployment descriptor of a specific service version. You must first create the app.yaml file for the default service of your app before you can create and deploy app.yaml files for additional services.

You can specify a unique name for your app.yaml files, but then you must specify the file name with the deployment command as well. For example, if you name your app.yaml file service-name-app.yaml or app.flexible.yaml, then you must deploy your app using either:

gcloud app deploy service-name-app.yaml
gcloud app deploy app.flexible.yaml
To learn more about structuring multiple services and app.yaml files in your app, see Structuring Web Services. Depending on the complexity of your app's service, you might only need to define a few elements in the corresponding app.yaml file. The following example demonstrates what a simple Java app might require in the flexible environment:

runtime: java
env: flex

handlers:
- url: /.*
  script: this field is required, but ignored
The syntax of the app.yaml file is in the YAML format.

All configuration elements

For a complete list of all the supported elements in this configuration file, see the app.yaml reference.

本頁內容對您是否有任何幫助?請提供意見:

傳送您對下列選項的寶貴意見...

這個網頁
App Engine flexible environment for Java docs