-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.lambda
More file actions
30 lines (24 loc) · 847 Bytes
/
Dockerfile.lambda
File metadata and controls
30 lines (24 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Dockerfile.lambda — Container image for AWS Lambda deployment.
#
# Re-uses the production wheel from the main Dockerfile's builder stage and
# layers it on top of the official AWS Lambda Python 3.11 base image, which
# bundles the Lambda Runtime Interface Client (RIC).
#
# Build:
# docker build -f Dockerfile.lambda -t meapy:lambda .
#
# Modify when:
# - Bumping the Lambda runtime base image
# - Changing the handler entrypoint
FROM python:3.11-slim AS base
ENV PIP_NO_CACHE_DIR=1
WORKDIR /build
COPY pyproject.toml README.md ./
COPY src/ ./src/
RUN pip install --upgrade pip build \
&& pip wheel --wheel-dir /wheels .
FROM public.ecr.aws/lambda/python:3.11
COPY --from=base /wheels/*.whl /tmp/
RUN pip install /tmp/*.whl && rm -rf /tmp/*.whl
COPY src/meapy/lambda_handler.py ${LAMBDA_TASK_ROOT}/
CMD ["lambda_handler.handler"]