Skip to main content

Docker Lambda

Serverless Docker deploy

Ensure that you changed serverless.yml to include required ENV variables!

Prerequirements:

  • AWS ECR(create it with terraform)
  • Configured AWS CLI

For deploying lambda running on Docker you need:

  1. run deploy target it will include - build production ready code - build docker image - push docker image to ECR - trigger serverless framework deploy command deploy targets have parameter :

    stage - Desired environment. [dev, prod]

To build the project a custom playwright image is used, which was built for arm and amd architectures and pushed to our AWS ECR, the custom image was used because aws-lambda-ric is not compatible with the playwright image provided by microsoft, because microsoft uses the latest version of 16 node and aws-lambda-ric supports version below 16.15 node

So the command to run to deploy your function is: nx run ${action-name}:deploy --stage={stage} --profile=default