FROM public.ecr.aws/lambda/nodejs:24

# The AWS Lambda base image sets WORKDIR to ${LAMBDA_TASK_ROOT} and provides the
# runtime interface client as its ENTRYPOINT — so we add dependencies, the handler,
# and a CMD only. No Lambda Web Adapter, no port, no EXPOSE (that's for web/api).

COPY package.json package-lock.json ./
RUN npm ci --omit=dev

COPY index.js ./

# "<file>.<exported function>" — resolves to index.js exports.handler
CMD ["index.handler"]
