Skip to content

Instantly share code, notes, and snippets.

@marsyang1
Created February 7, 2020 07:39
Show Gist options
  • Save marsyang1/c98bb7d0c7d5610adcd8eccdb4801d7d to your computer and use it in GitHub Desktop.
Save marsyang1/c98bb7d0c7d5610adcd8eccdb4801d7d to your computer and use it in GitHub Desktop.

Doing at cloud shell

composer create-project --prefer-dist laravel/laravel [YOUR-PROJECT-NAME]

cloud shell test run

php artisan serve

vi app.yaml

runtime: php72

env_variables:
  ## Put production environment variables here.
  APP_KEY: YOUR_APP_KEY
  APP_STORAGE: /tmp
  VIEW_COMPILED_PATH: /tmp
  SESSION_DRIVER: cookie
  • php artisan key:generate --show --> paste into app.yaml
  • Modify bootstrap/app.php , adding the following block of code before the return statement.
# [START] Add the following block to `bootstrap/app.php`
/*
|--------------------------------------------------------------------------
| Set Storage Path
|--------------------------------------------------------------------------
|
| This script allows you to override the default storage location used by
| the  application.  You may set the APP_STORAGE environment variable
| in your .env file,  if not set the default location will be used
|
*/
$app->useStoragePath(env('APP_STORAGE', base_path() . '/storage'));
# [END]

  • remove dev dependency
composer remove --dev beyondcode/laravel-dump-server
composer remove --dev facade/ignition

  • deploy app
gcloud app deploy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment