You can run gcloud help preview app run
to show a man page describing the run command and its parameters. --custom-entrypoint
is described as:
--custom-entrypoint CUSTOM_ENTRYPOINT
Specify an entrypoint for custom runtime modules. This is required when
such modules are present. Include "{port}" in the string (without
quotes) to pass the port number in as an argument. For instance:
--custom_entrypoint="gunicorn -b localhost:{port} mymodule:application"
Note that the error message says --custom_entrypoint
, with an underscore, but the parameter is --customer_entrypoint
, with a dash. The correct name is --custom-entrypoint
see: https://code.google.com/p/google-cloud-sdk/issues/detail?id=191
For a nodejs you should be able to use something like:
gcloud preview app run app.yaml --project=your-project-id --custom-entrypoint "node index.js {port}"
Depending on how you start your application. The port seems to also be available as the environment variable PORT so you don't need to use {port}
if your app does not handle command line arguments.
I haven't been able to use npm start
or other npm run <script>
from the --custom-entrypoint
however.
gcloud components update
after). – Schmaltzy