Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@9oelM
Created March 21, 2021 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 9oelM/a0708ef80b15f6c396a99810aacf0a7a to your computer and use it in GitHub Desktop.
Save 9oelM/a0708ef80b15f6c396a99810aacf0a7a to your computer and use it in GitHub Desktop.
FROM amazon/aws-lambda-nodejs:14 AS builder
WORKDIR /usr/app
COPY package*.json tsconfig.json ./
RUN npm install
COPY ./lib ./lib/
RUN npm run build
RUN ls -la # for debugging
FROM amazon/aws-lambda-nodejs:14
# CMD ["path-to-file.function-name"]
WORKDIR /usr/app
COPY package*.json ./
RUN npm install --only=prod
COPY --from=builder /usr/app/lib /usr/app/lib
CMD [ "/usr/app/lib/index.handler" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment