-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
78 lines (74 loc) · 1.71 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
service: veresk
plugins:
- serverless-python-requirements
- serverless-wsgi
- serverless-apigw-binary
- serverless-domain-manager
custom:
customDomain:
domainName: ${env:CUSTOM_DOMAIN, 'veresk.ruslan.org'}
createRoute53Record: true
endpointType: edge
enabled: ${env:CUSTOM_DOMAIN_ENABLED, 'true'}
wsgi:
app: app.app
packRequirements: false
pythonRequirements:
dockerizePip: non-linux
# Add binary images as handled in API gateway
apigwBinary:
types:
- "image/*"
- "application/font*"
- "application/pdf"
# This allows binary conversion without Accept: image/* in request
- "*/*"
provider:
name: aws
runtime: python3.7
timeout: 30
stage: dev
memorySize: 2048
region: eu-west-1
environment:
MONGO_URI: ${env:MONGO_URI}
FLASK_SECRET_KEY: ${env:FLASK_SECRET_KEY}
CACHE_BUCKET: ${env:CACHE_BUCKET}
PROD_GITHUB_OAUTH_CLIENT_ID: ${env:PROD_GITHUB_OAUTH_CLIENT_ID}
PROD_GITHUB_OAUTH_CLIENT_SECRET: ${env:PROD_GITHUB_OAUTH_CLIENT_SECRET}
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:*"
Resource:
Fn::Join:
- ""
- - "arn:aws:s3:::"
- ${env:CACHE_BUCKET}
- Effect: "Allow"
Action:
- "s3:*"
Resource:
Fn::Join:
- ""
- - "arn:aws:s3:::"
- ${env:CACHE_BUCKET}
- "/*"
package:
exclude:
- "README.md"
- ".editorconfig"
- "LICENSE.md"
- ".git/**"
- ".github/**"
- ".vscode/**"
- ".gitignore"
- "node_modules/**"
- "test/**"
- "app/static/preview.png"
functions:
app:
handler: wsgi_handler.handler
events:
- http: ANY /
- http: "ANY {proxy+}"