-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
63 lines (58 loc) · 1.89 KB
/
serverless.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Read the documentation at https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/
service: leeds-talk-blog
provider:
lambdaHashingVersion: 20201221
name: aws
# The AWS region in which to deploy (us-east-1 is the default)
region: eu-west-2 # London
# The stage of the application, e.g. dev, production, staging… ('dev' is the default)
stage: dev
runtime: provided.al2
environment:
# Symfony environment variables
APP_ENV: prod
DATABASE_URL: ${construct:database.databaseUrl}
plugins:
- ./vendor/bref/bref
- serverless-lift
functions:
# This function runs the Symfony website/API
web:
handler: public/index.php
timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds)
layers:
- ${bref:layer.php-80-fpm}
events:
- httpApi: '*'
# This function let us run console commands in Lambda
console:
handler: bin/console
timeout: 120 # in seconds
layers:
- ${bref:layer.php-80} # PHP
- ${bref:layer.console} # The "console" layer
constructs:
website:
type: server-side-website
assets:
'/build/*': public/build
'/favicon.ico': public/favicon.ico
'/apple-touch-icon.png': public/apple-touch-icon.png
'/robots.txt': public/robots.txt
database:
type: database/sql
engine: postgres
password: ${env:DB_PASSWORD}
package:
patterns:
# Excluded files and folders for deployment
- '!assets/**'
- '!node_modules/**'
- '!public/build/**'
- '!tests/**'
- '!var/**'
# If you want to include files and folders that are part of excluded folders,
# add them at the end
- 'var/cache/prod/**'
- 'public/build/entrypoints.json'
- 'public/build/manifest.json'