-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
63 lines (50 loc) · 1.31 KB
/
Dockerfile
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Define custom function directory
ARG FUNCTION_DIR="/function"
FROM python:3.8-buster as build-image
# Include global arg in this stage of the build
ARG FUNCTION_DIR
# Install aws-lambda-cpp build dependencies
RUN apt-get update && \
apt-get install -y \
g++ \
make \
cmake \
unzip \
libcurl4-openssl-dev
# Copy function code
RUN mkdir -p ${FUNCTION_DIR}
# Install the function's dependencies
RUN pip install \
--target ${FUNCTION_DIR} \
awslambdaric \
boto3 \
redis \
httplib2 \
requests \
numpy \
scipy \
pandas \
pika==0.13.1 \
kafka-python \
cloudpickle \
ps-mem \
tblib
# Additional dependencies
RUN pip install \
--target ${FUNCTION_DIR} \
smart_open
FROM python:3.8-buster
# Include global arg in this stage of the build
ARG FUNCTION_DIR
# Set working directory to function root directory
WORKDIR ${FUNCTION_DIR}
# Copy in the built dependencies
COPY --from=build-image ${FUNCTION_DIR} ${FUNCTION_DIR}
# Add Lithops
RUN mkdir lithops
COPY lithops_lambda.zip ${FUNCTION_DIR}
RUN unzip lithops_lambda.zip && rm lithops_lambda.zip
# Add the gensort executable
COPY gensort-1.5 ${FUNCTION_DIR}
ENTRYPOINT [ "/usr/local/bin/python", "-m", "awslambdaric" ]
CMD [ "__main__.lambda_handler" ]