logo
Menu

Serverless Containers Deep Dive with AJ | S03 E02 | Build On Weekly

Amazing AWS Serverless Hero AJ Stuyvenberg is here to dive deep into world of Serverless Containers

Rohini Gaonkar
Amazon Employee
Published Feb 2, 2024
Hosts and Guest on screen
Hosts and Guest on screen
On this episode we have the amazing AWS Serverless Hero AJ Stuyvenberg and his dog Taco to dive deep into the world of Serverless Containers.
AJ showed us how its easy to use AWS Lambda Web Adapter, an open source tool, to run web application on AWS Lambda with docker containers and how you can quickly deploy an application using AWS App Runner.
Here are the app.js and dockerfile files we used for today's deployment:
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const express = require('express')
const app = express()

process.on('SIGTERM', async ( => {
process.exit(0)
}))

app.get('/', (req, res) => {
console.log('[ASTUYVE] got a request')
res.status(200)
res.send(
JSON.stringfy({
hello: 'world'
})
)
})
dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
FROM public.ecr.aws/lambda/nodejs:20

#install web adapter
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.8.1 /lambda-adapter /opt/extensions/lambda-adapter
EXPOSE 8080

WORKDIR "/var/task"
ADD ./package.json /var/task/package.json
ADD ./package-lock.json /var/task/package-lock.json
RUN npm install --omit=dev
ADD ./ /var/task

#You can overwrite command in 'serverless.yml' template
ENTRYPOINT ["node", "app.js"]
We also dived deep into Lambda cold starts - how container-based Lambda functions can initialize faster, the work Lambda team did behind the scenes for the amazing performance advantages and how you can make use of it for your next Serverless deployments.
If you are looking to learn a bit about:
  • How not to hug a server!
  • How to use Containers with AWS Lambda
  • How to use Lambda Web Adapter and App Runner
  • How Lambda improved cold starts performance
  • and more
Make sure to check out the full stream recording here:
Loading...

Links from episode

Reach out to the hosts and guests:

Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.

Comments