| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
Cloud Run runs stateless containers on a fully managed environment or in your own GKE cluster.
| Sample | Description | Deploy |
|---|---|---|
| Hello World | Quickstart | |
| Laravel | Deploy Laravel on Cloud Run | - |
| Multi-container | Multi-container samples (i.e nginx) | - |
For more Cloud Run samples beyond PHP, see the main list in the Cloud Run Samples repository.
Clone this repository:
git clone https://github.com/GoogleCloudPlatform/php-docs-samples.git
cd php-docs-samples/runexport SAMPLE='helloworld'
cd $SAMPLE
docker build --tag $SAMPLE .With the built container:
PORT=8080 && docker run --rm -p 8080:${PORT} -e PORT=${PORT} $SAMPLEOverriding the built container with local code:
PORT=8080 && docker run --rm \
-p 8080:${PORT} -e PORT=${PORT} \
-v $PWD:/usr/src/app $SAMPLEInjecting your service account key:
export SA_KEY_NAME=my-key-name-123
PORT=8080 && docker run --rm \
-p 8080:${PORT} -e PORT=${PORT} \
-e GOOGLE_APPLICATION_CREDENTIALS=/tmp/keys/${SA_KEY_NAME}.json \
-v $GOOGLE_APPLICATION_CREDENTIALS:/tmp/keys/${SA_KEY_NAME}.json:ro \
-v $PWD:/usr/src/app $SAMPLEOpening a shell in the container:
Build the container.
Run the container with a shell:
PORT=8080 && docker run --rm \
--interactive --tty \
-p 8080:${PORT} -e PORT=${PORT} \
-v $PWD:/var/www/html $SAMPLE \
/bin/bashExit the container: Ctrl-D
See Building containers and Deploying container images for more information.
| Back | FazBrowse Home | New Git URL |