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" },