Skip to content

Commit

Permalink
/deploy sit
Browse files Browse the repository at this point in the history
  • Loading branch information
sliu008 committed Jan 7, 2025
1 parent 6e3c6d2 commit 6f0ca42
Showing 1 changed file with 18 additions and 23 deletions.
41 changes: 18 additions & 23 deletions docker/lambdaDockerfileArm
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
# Use the AWS Lambda base image for Python 3.11 (ARM64 architecture)
#ARG FUNCTION_DIR="/function"

FROM public.ecr.aws/lambda/python:3.11-arm64

# Global build arguments and environment variables
# Include global arg in this stage of the build
ARG SOURCE
ARG DIST_PATH=dist/
ENV LAMBDA_TASK_ROOT=/var/task

# Install required packages and cleanup in a single layer to reduce image size
RUN yum -q -y install gcc && \
# Install dependencies
pip3 install awslambdaric --target $LAMBDA_TASK_ROOT && \
# Copy and install the package
mkdir -p $DIST_PATH && \
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 && \
# Cleanup to reduce image size
yum -y remove gcc && \
yum clean all && \
rm -rf /var/cache/yum && \
rm -rf $DIST_PATH

# Copy any distribution files (if needed)

RUN yum -q -y install gcc

# Create function directory
# RUN mkdir -p ${FUNCTION_DIR}
# WORKDIR ${FUNCTION_DIR}

# Install tig from artifactory
COPY $DIST_PATH $DIST_PATH

# Lambda entry point and handler
# install tig 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

RUN rm -rf $DIST_PATH

ENTRYPOINT []
CMD ["podaac.lambda_handler.lambda_handler.handler"]

0 comments on commit 6f0ca42

Please sign in to comment.