-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
106 lines (98 loc) · 2.29 KB
/
serverless.yml
File metadata and controls
106 lines (98 loc) · 2.29 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
service: assembleo-core
frameworkVersion: '4'
provider:
name: aws
runtime: nodejs20.x
region: sa-east-1
stage: ${opt:stage, 'dev'}
timeout: 30
memorySize: 1024
environment:
NODE_ENV: ${self:provider.stage}
DATABASE_URL: ${env:DATABASE_URL}
CLOUDFLARE_R2_BASE_URL: ${env:CLOUDFLARE_R2_BASE_URL}
CLOUDFLARE_R2_BUCKET: ${env:CLOUDFLARE_R2_BUCKET}
CLOUDFLARE_R2_ACCESS_KEY_ID: ${env:CLOUDFLARE_R2_ACCESS_KEY_ID}
CLOUDFLARE_R2_SECRET_ACCESS_KEY: ${env:CLOUDFLARE_R2_SECRET_ACCESS_KEY}
CLOUDFLARE_R2_REGION: ${env:CLOUDFLARE_R2_REGION}
CLOUDFLARE_R2_PUBLIC_BASE_URL: ${env:CLOUDFLARE_R2_PUBLIC_BASE_URL}
# IAM Permissions
iam:
role:
statements:
- Effect: Allow
Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
Resource: '*'
# API Gateway configuration
httpApi:
cors:
allowedOrigins:
- '*'
allowedHeaders:
- Content-Type
- Authorization
allowedMethods:
- GET
- POST
- PUT
- DELETE
- PATCH
- OPTIONS
allowCredentials: true
plugins:
- serverless-esbuild
- serverless-dotenv-plugin
- serverless-offline
functions:
main:
handler: src/lambda.handler
events:
- http:
method: ANY
path: /
- http:
method: ANY
path: '{proxy+}'
package:
individually: false
patterns:
- 'assets/**'
- '!.git/**'
- '!.vscode/**'
- '!test/**'
- '!coverage/**'
- '!src/**'
- '!.env*'
- '!README.md'
- '!docker-compose.yml'
- '!Dockerfile'
- '!node_modules/.prisma/client/libquery_engine-*'
- 'node_modules/.prisma/client/libquery_engine-rhel-*'
- '!node_modules/prisma/libquery_engine-*'
- '!node_modules/@prisma/engines/**'
custom:
esbuild:
bundle: true
minify: false
sourcemap: false
exclude:
- '@aws-sdk/*'
target: 'node20'
platform: 'node'
concurrency: 10
external:
- '@prisma/client'
- 'prisma'
packager: npm
packagePath: package.json
packagerOptions:
scripts:
- npm --prefix ./node_modules/.prisma/client run postinstall || true
serverless-offline:
httpPort: 3000
lambdaPort: 3002
dotenv:
path: .env