-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.augmentation
More file actions
43 lines (32 loc) · 1.85 KB
/
Dockerfile.augmentation
File metadata and controls
43 lines (32 loc) · 1.85 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM public.ecr.aws/lambda/python:3.12
LABEL org.opencontainers.image.source=https://github.com/CDCgov/dibbs-text-to-code
LABEL org.opencontainers.image.licenses=Apache-2.0
# Set the environment variable to prod by default
ARG ENVIRONMENT=prod
ENV ENVIRONMENT=${ENVIRONMENT}
# Update OS packages for CVE fixes and drop the Runtime Interface Emulator
# (only used for local Lambda emulation). All pip dependencies install from
# prebuilt wheels, so no compiler toolchain is needed — keeping gcc-c++ out
# of the image also keeps its build-time deps (kernel-headers, rust-toolset)
# off the runtime layer, which is where the HIGH-severity CVEs come from.
# --releasever=latest is required: AL2023 base images pin to a snapshot release.
RUN microdnf update -y --releasever=latest \
&& microdnf clean all \
&& rm -f /usr/local/bin/aws-lambda-rie
# Copy and install workspace packages in dependency order
COPY ./packages/shared-models ${LAMBDA_TASK_ROOT}/shared-models
RUN pip install --no-cache-dir "${LAMBDA_TASK_ROOT}/shared-models"
COPY ./packages/utils ${LAMBDA_TASK_ROOT}/utils
RUN pip install --no-cache-dir "${LAMBDA_TASK_ROOT}/utils"
COPY ./packages/lambda-handler ${LAMBDA_TASK_ROOT}/lambda-handler
RUN pip install --no-cache-dir "${LAMBDA_TASK_ROOT}/lambda-handler"
COPY ./packages/augmentation ${LAMBDA_TASK_ROOT}/augmentation
RUN pip install --no-cache-dir "${LAMBDA_TASK_ROOT}/augmentation"
COPY ./packages/augmentation-lambda ${LAMBDA_TASK_ROOT}/augmentation-lambda
RUN pip install --no-cache-dir "${LAMBDA_TASK_ROOT}/augmentation-lambda" \
&& pip install --no-cache-dir --upgrade "urllib3>=2.7.0"
# Copy over the rest of the code
COPY ./packages/augmentation-lambda/src ${LAMBDA_TASK_ROOT}/src
COPY README.md ${LAMBDA_TASK_ROOT}/README.md
ENV PYTHONPATH="${LAMBDA_TASK_ROOT}/src/augmentation_lambda"
CMD [ "augmentation_lambda.lambda_function.handler" ]