Skip to content

Commit

Permalink
feat: Laravel on Cloud Run (#1680)
Browse files Browse the repository at this point in the history
  • Loading branch information
glasnt authored Dec 13, 2022
1 parent 1d11e68 commit f9a2245
Show file tree
Hide file tree
Showing 94 changed files with 4,398 additions and 0 deletions.
3 changes: 3 additions & 0 deletions run/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
| Sample | Description | Deploy |
| --------------------------------------- | ------------------------ | ------------- |
|[Hello World][helloworld] | Quickstart | [<img src="https://storage.googleapis.com/cloudrun/button.svg" alt="Run on Google Cloud" height="30"/>][run_button_helloworld] |
|[Laravel][laravel] | Deploy Laravel on Cloud Run | -|


For more Cloud Run samples beyond PHP, see the main list in the [Cloud Run Samples repository](https://github.com/GoogleCloudPlatform/cloud-run-samples).

Expand Down Expand Up @@ -87,4 +89,5 @@ for more information.
[run_build]: https://cloud.google.com/run/docs/building/containers
[run_deploy]: https://cloud.google.com/run/docs/deploying
[helloworld]: helloworld/
[laravel]: laravel/
[run_button_helloworld]: https://deploy.cloud.run/?dir=run/helloworld
22 changes: 22 additions & 0 deletions run/laravel/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
APP_NAME=MyApp
APP_ENV=local

# this value will be generated
APP_KEY=


# Logging
LOG_CHANNEL=syslog
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

# Database
DB_CONNECTION=mysql
DB_SOCKET=/cloudsql/PROJECT_ID:REGION:INSTANCE
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=

# Static (generate ASSET_URL from the bucket name)
ASSET_BUCKET=BUCKET_NAME
ASSET_URL=https://storage.googleapis.com/${ASSET_BUCKET}
2 changes: 2 additions & 0 deletions run/laravel/.gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!include:.gitignore
.git
17 changes: 17 additions & 0 deletions run/laravel/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
Homestead.json
Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
/.idea
/.vscode
package.lock
3 changes: 3 additions & 0 deletions run/laravel/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
web: pid1 --nginxBinaryPath nginx --nginxConfigPath /layers/google.php.webconfig/webconfig/nginx.conf --serverConfigPath /layers/google.php.webconfig/webconfig/nginxserver.conf --nginxErrLogFilePath /var/log/nginx.log --customAppCmd "php-fpm -R --nodaemonize --fpm-config /layers/google.php.webconfig/webconfig/php-fpm.conf" --pid1LogFilePath /var/log/pid1.log --mimeTypesPath /layers/google.utils.nginx/nginx/conf/mime.types --customAppSocket /layers/google.php.webconfig/webconfig/app.sock
migrate: php artisan migrate
static: npm run update-static
Loading

0 comments on commit f9a2245

Please sign in to comment.