33This is a wrapper Docker image that sets up an environment similar to the
44[ Google App Engine Flexible Environment] ( https://cloud.google.com/appengine/docs/flexible/ ) ,
55suitable for running scripts and maintenance tasks provided by an application
6- deployed to App Engine. In particular, it ensures a suitable CloudSQL Proxy
6+ deployed to App Engine. In particular, it ensures a suitable Cloud SQL Proxy
77is running in the environment.
88
99Its driving use case is running production database migrations for Ruby on
10- Rails applications, and we expect similar uses for other languasges and
11- frameworks.
10+ Rails applications, but it is also useful for Django applications, and we
11+ expect similar uses for other languages and frameworks.
1212
1313## Usage
1414
@@ -31,6 +31,43 @@ You can find the image path using `gcloud app versions describe`.
3131Ruby developers may use the [ appengine gem] ( https://rubygems.org/gems/appengine )
3232for a convenient Rake-based interface.
3333
34+ ## Usage for Cloud Run
35+
36+ This wrapper can also be used for applications deployed to Cloud Run by defining
37+ your image name in the arguments. It would typically be added after your image build and image push steps"
38+
39+ steps:
40+ ...
41+ - name: "gcr.io/google-appengine/exec-wrapper"
42+ args: ["-i", "gcr.io/my-project/my-image",
43+ ...]
44+
45+
46+ If the Cloud Run image is built with [ Google Cloud Buildpacks] ( https://github.com/GoogleCloudPlatform/buildpacks ) ,
47+ you must define an entrypoint. By default you can use the ` launcher ` entrypoint:
48+
49+
50+ steps:
51+ ...
52+ - name: "gcr.io/google-appengine/exec-wrapper"
53+ args: [...
54+ "-r", "launcher",
55+ "--", "bundle", "exec", "rake", "db:migrate"]
56+
57+ Alternatively, you can define your migration command as an entrypoint in ` Procfile ` ,
58+ and use that instead of a direct command:
59+
60+ # Procfile
61+ web: bundle exec rails server
62+ migrate: bundle exec rake db:migrate
63+
64+ # cloudbuild.yaml
65+ steps:
66+ ...
67+ - name: "gcr.io/google-appengine/exec-wrapper"
68+ args: [...
69+ "-r", "migrate"]
70+
3471## Building and testing
3572
3673See the main readme in this repository for information on the build, test, and
0 commit comments