Creates a serverless framework environment with Node.js(4.3) and Python(2.7) installed. Run from your app source directory to mount into the container's /app directory.
docker build -t serverless-env .
docker run -it -e USER -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION \
-v $(PWD):/app/ \
serverless-env
Container should be previously built.
docker run -it -e USER -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION \
-v $(PWD):/app/ \
serverless-env:1.26.0
serverless create --template aws-nodejs
serverless deploy
serverless invoke --function hello
Add event to handler config in serverless.yml
functions:
hello:
handler: handler.hello
events:
- http: GET hello
Deploy the updated service. Endpoint url will be displayed in the output.