-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
#ARG FUNCTION_DIR="/function" | ||
|
||
# Use the AWS Lambda base image for Python 3.11 (ARM64 architecture) | ||
FROM public.ecr.aws/lambda/python:3.11-arm64 | ||
|
||
# Include global arg in this stage of the build | ||
# Global build arguments | ||
ARG SOURCE | ||
ARG DIST_PATH=dist/ | ||
ENV LAMBDA_TASK_ROOT=/var/task | ||
|
||
RUN yum -q -y install gcc | ||
|
||
# Create function directory | ||
# RUN mkdir -p ${FUNCTION_DIR} | ||
# WORKDIR ${FUNCTION_DIR} | ||
# Install required packages | ||
RUN yum -q -y install gcc || microdnf install gcc | ||
|
||
# Install forge-py from artifactory | ||
# Copy the distribution package into the container | ||
COPY $DIST_PATH $DIST_PATH | ||
|
||
# install forge-py into working directory so we can call lambda | ||
RUN pip3 install awslambdaric --target $LAMBDA_TASK_ROOT | ||
|
||
RUN pip3 install --no-cache-dir --force --index-url https://pypi.org/simple/ --extra-index-url https://test.pypi.org/simple/ --target "${LAMBDA_TASK_ROOT}" $SOURCE | ||
# Install dependencies into the Lambda task root | ||
RUN pip3 install awslambdaric --target $LAMBDA_TASK_ROOT \ | ||
&& pip3 install --no-cache-dir --force --index-url https://pypi.org/simple/ \ | ||
--extra-index-url https://test.pypi.org/simple/ --target $LAMBDA_TASK_ROOT $SOURCE | ||
|
||
# Remove the distribution files to reduce image size | ||
RUN rm -rf $DIST_PATH | ||
|
||
# Lambda entry point and handler | ||
ENTRYPOINT [] | ||
CMD ["podaac.lambda_handler.lambda_handler.handler"] | ||
CMD ["podaac.lambda_handler.lambda_handler.handler"] |