-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlambdaDockerfile
49 lines (35 loc) · 1.38 KB
/
lambdaDockerfile
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
44
45
46
47
48
ARG FUNCTION_DIR="/function"
FROM python:3.10-slim as build-image
# Include global arg in this stage of the build
ARG FUNCTION_DIR
ARG SOURCE
#ARG TIG_SOURCE
# Install aws-lambda-cpp build dependencies
RUN apt-get update && \
apt-get install -y \
g++ \
make \
cmake \
unzip \
libcurl4-openssl-dev \
wget
# Create function directory
RUN mkdir -p ${FUNCTION_DIR}
WORKDIR ${FUNCTION_DIR}
COPY $DIST_PATH $DIST_PATH
# install tig into working directory so we can call lambda
#RUN pip3 install --force --target ${FUNCTION_DIR} $SOURCE
#RUN pip3 install --no-cache-dir --force --user --index-url https://pypi.org/simple/ --extra-index-url https://test.pypi.org/simple/ --target ${FUNCTION_DIR} $SOURCE
RUN pip3 install --no-cache-dir --force --index-url https://pypi.org/simple/ --extra-index-url https://test.pypi.org/simple/ --target ${FUNCTION_DIR} $SOURCE
RUN rm -rf $DIST_PATH
# Install the function's dependencies
RUN pip install \
--target ${FUNCTION_DIR} \
awslambdaric
# Install cumulus message adapter layer
# RUN wget https://github.com/nasa/cumulus-message-adapter/releases/download/v1.3.0/cumulus-message-adapter.zip
# RUN mkdir cumulus-message-adapter
# RUN unzip -d cumulus-message-adapter cumulus-message-adapter.zip
# ENV CUMULUS_MESSAGE_ADAPTER_DIR=${FUNCTION_DIR}/cumulus-message-adapter
ENTRYPOINT []
CMD ["podaac.lambda_handler.lambda_handler.handler"]