From 50730ac32f41856a5b4ce202d2c52441dc9b6b87 Mon Sep 17 00:00:00 2001 From: William Sawyer Date: Fri, 22 Dec 2023 00:11:22 +1000 Subject: [PATCH] Correct containerisation --- Dockerfile | 7 +++++-- tsconfig.json | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c82f0f6..9c967df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,8 @@ FROM public.ecr.aws/lambda/nodejs:20 as build-image WORKDIR /usr/app -COPY package.json package-lock.json tsconfig.json index.ts ./ +COPY package.json package-lock.json tsconfig.json ./ +COPY src/index.ts ./src/ RUN npm clean-install RUN npm run build @@ -11,6 +12,8 @@ FROM public.ecr.aws/lambda/nodejs:20 WORKDIR ${LAMBDA_TASK_ROOT} -COPY --from=build-image /usr/app/dist/* ./ +COPY --from=build-image /usr/app/dist/index.js ./ + +RUN npm clean-install --omit dev CMD ["index.handler"] diff --git a/tsconfig.json b/tsconfig.json index 026ace0..d063b56 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,7 @@ "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "module": "NodeNext", + "outDir": "dist", "strict": true, "target": "ES6" },