File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change 1- FROM public.ecr.aws/lambda/python:latest
1+ ARG FUNCTION_DIR= "/function"
22
3- COPY requirements.txt ./
4- COPY lambda.py ./
3+ FROM python:3.11 as build-image
54
6- RUN python3 -m pip install -r requirements.txt
5+ ARG FUNCTION_DIR
76
8- ENV AWS_ACCESS_KEY_ID 000
9- ENV AWS_SECRET_ACCESS_KEY 000
10- ENV AWS_SESSION_TOKEN 000
7+ RUN mkdir -p ${FUNCTION_DIR}
8+ COPY lambda.py ${FUNCTION_DIR}
9+ COPY requirements.txt ${FUNCTION_DIR}
1110
12- CMD ["lambda.lambda_handler" ]
11+ RUN pip install --target ${FUNCTION_DIR} -r "${FUNCTION_DIR}/requirements.txt"
12+ RUN pip install --target ${FUNCTION_DIR} awslambdaric
13+
14+ FROM python:3.11-slim
15+
16+ ARG FUNCTION_DIR
17+ WORKDIR ${FUNCTION_DIR}
18+
19+ COPY --from=build-image ${FUNCTION_DIR} ${FUNCTION_DIR}
20+
21+ ENTRYPOINT [ "/usr/local/bin/python" , "-m" , "awslambdaric" ]
22+ CMD [ "lambda.handler" ]
You can’t perform that action at this time.
0 commit comments