Deploying to App Engine

Store container images and dependencies for your applications in Artifact Registry for deployment to App Engine.

Required permissions

App Engine flexible environment
If App Engine flexible environment and Artifact Registry short are in the same project, the App Engine default service account has permissions to pull containers from repositories.
If you also use Cloud Build to containerize your applications and store them in Artifact Registry, grant the Artifact Registry Writer role to the Cloud Build service account.
App Engine standard environment:
App Engine standard environment uses the Cloud Build service account to build and deploy your applications, including integration of dependencies stored in Artifact Registry.
  • If App Engine and Artifact Registry are in the same Google Cloud project, the service account has the necessary permissions to download from repositories.
  • If App Engine and Artifact Registry are in different projects, you must grant repository access to the service account.
  • To provide read-only access for downloading dependencies, grant the Artifact Registry Reader role to the Cloud Build service account.
  • If you also use Cloud Build to upload artifacts to repositories, grant the Artifact Registry Writer role to the Cloud Build service account.

Deploy to App Engine flexible environment

You can deploy an image hosted by Artifact Registry to App Engine using the Google Cloud CLI.

  1. Create the App Engine configuration file for your app.
  2. Build a Docker image and push it to your repository. You can use Cloud Build to build and push your container to the repository.
  3. Deploy your image to App Engine by running the following command:

    gcloud app deploy --image-url=LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY/IMAGE:TAG
    

    where:

    • LOCATION is the regional or multi-regional location of the repository.
    • PROJECT is ID of the project that contains the repository. If your project ID contains a colon (:), see Domain-scoped projects.
    • REPOSITORY is the name of the repository where the image is stored.
    • IMAGE is the name of the image in the repository.
    • TAG is the tag of the image version that you want to pull.

    For example:

    gcloud app deploy --image-url=us-central1-docker.pkg.dev/my-project/my-repo/my-image:1.0
    

Configure access to dependencies

For standard environment applications, see the App Engine standard environment documentation for npm and Python configuration instructions.

To include dependencies in builds you run with Cloud Build, see Integrating with Cloud Build.