Skip to content

Commit 0642b5a

Browse files
authored
Merge pull request #100 from brefphp/improve-serverless-yml
2 parents 1c338e9 + 73105a4 commit 0642b5a

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

stubs/serverless.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ provider:
44
name: aws
55
# The AWS region in which to deploy (us-east-1 is the default)
66
region: us-east-1
7-
# The stage of the application, e.g. dev, production, staging… ('dev' is the default)
8-
stage: dev
9-
runtime: provided.al2
7+
# Environment variables
8+
environment:
9+
APP_ENV: production # Or use ${sls:stage} if you want the environment to match the stage
1010

1111
package:
12-
# Directories to exclude from deployment
12+
# Files and directories to exclude from deployment
1313
patterns:
1414
- '!node_modules/**'
1515
- '!public/storage'
@@ -22,24 +22,21 @@ functions:
2222
# This function runs the Laravel website/API
2323
web:
2424
handler: public/index.php
25+
runtime: php-81-fpm
2526
timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds)
26-
layers:
27-
- ${bref:layer.php-81-fpm}
2827
events:
2928
- httpApi: '*'
3029

3130
# This function lets us run artisan commands in Lambda
3231
artisan:
3332
handler: artisan
33+
runtime: php-81-console
3434
timeout: 720 # in seconds
35-
layers:
36-
- ${bref:layer.php-80} # PHP
37-
- ${bref:layer.console} # The "console" layer
38-
events:
39-
# We also schedule this function to run the scheduler every minute
40-
- schedule:
41-
rate: rate(1 minute)
42-
input: '"schedule:run"'
35+
# Uncomment to also run the scheduler every minute
36+
#events:
37+
# - schedule:
38+
# rate: rate(1 minute)
39+
# input: '"schedule:run"'
4340

4441
plugins:
4542
# We need to include the Bref plugin

0 commit comments

Comments
 (0)