Skip to content

Commit

Permalink
Merge pull request brefphp#100 from brefphp/improve-serverless-yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli authored Mar 20, 2023
2 parents 1c338e9 + 73105a4 commit 0642b5a
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions stubs/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ provider:
name: aws
# The AWS region in which to deploy (us-east-1 is the default)
region: us-east-1
# The stage of the application, e.g. dev, production, staging… ('dev' is the default)
stage: dev
runtime: provided.al2
# Environment variables
environment:
APP_ENV: production # Or use ${sls:stage} if you want the environment to match the stage

package:
# Directories to exclude from deployment
# Files and directories to exclude from deployment
patterns:
- '!node_modules/**'
- '!public/storage'
Expand All @@ -22,24 +22,21 @@ functions:
# This function runs the Laravel website/API
web:
handler: public/index.php
runtime: php-81-fpm
timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds)
layers:
- ${bref:layer.php-81-fpm}
events:
- httpApi: '*'

# This function lets us run artisan commands in Lambda
artisan:
handler: artisan
runtime: php-81-console
timeout: 720 # in seconds
layers:
- ${bref:layer.php-80} # PHP
- ${bref:layer.console} # The "console" layer
events:
# We also schedule this function to run the scheduler every minute
- schedule:
rate: rate(1 minute)
input: '"schedule:run"'
# Uncomment to also run the scheduler every minute
#events:
# - schedule:
# rate: rate(1 minute)
# input: '"schedule:run"'

plugins:
# We need to include the Bref plugin
Expand Down

0 comments on commit 0642b5a

Please sign in to comment.