Store container images and dependencies for your applications in Artifact Registry for deployment to App Engine.
- Declare dependencies in Artifact Registry in your Node.js and Python applications.
- Deploy your application directly to App Engine standard environment, or containerize and deploy it to App Engine flexible environment with Cloud Build.
- Store container images in Artifact Registry Docker repositories and deploy them to App Engine flexible environment.
- 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.
- Create the App Engine configuration file for your app.
- Build a Docker image and push it to your repository. You can use Cloud Build to build and push your container to the repository.
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
- 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.
gcloud app deploy --image-url=us-central1-docker.pkg.dev/my-project/my-repo/my-image:1.0
Configure access to dependencies
To include dependencies in builds you run with Cloud Build, see Integrating with Cloud Build.