Skip to content

Commit 42ede93

Browse files
committed
Dockerfile
1 parent 6828aa8 commit 42ede93

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

Dockerfile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Python 3.12
2+
FROM python:3.12-slim-bookworm
3+
4+
RUN apt-get update \
5+
# Install aws-lambda-cpp build dependencies
6+
&& apt-get install -y \
7+
g++ \
8+
make \
9+
cmake \
10+
unzip \
11+
# cleanup package lists, they are not used anymore in this image
12+
&& rm -rf /var/lib/apt/lists/* \
13+
&& apt-cache search linux-headers-generic
14+
15+
ARG FUNCTION_DIR="/function"
16+
17+
# Copy function code
18+
RUN mkdir -p ${FUNCTION_DIR}
19+
20+
# Update pip
21+
RUN pip install --upgrade --ignore-installed pip wheel six setuptools \
22+
&& pip install --upgrade --no-cache-dir --ignore-installed \
23+
awslambdaric \
24+
botocore \
25+
boto3 \
26+
redis \
27+
httplib2 \
28+
requests \
29+
numpy \
30+
scipy \
31+
pandas \
32+
pika \
33+
kafka-python \
34+
cloudpickle \
35+
ps-mem \
36+
tblib
37+
38+
# Set working directory to function root directory
39+
WORKDIR ${FUNCTION_DIR}
40+
41+
# Add Lithops
42+
COPY lithops_lambda.zip ${FUNCTION_DIR}
43+
RUN unzip lithops_lambda.zip \
44+
&& rm lithops_lambda.zip \
45+
&& mkdir handler \
46+
&& touch handler/__init__.py \
47+
&& mv entry_point.py handler/
48+
49+
RUN pip install \
50+
cubed \
51+
s3fs
52+
53+
# Add extra dependencies here
54+
# RUN pip install my-package another-package
55+
56+
ENTRYPOINT [ "/usr/local/bin/python", "-m", "awslambdaric" ]
57+
CMD [ "handler.entry_point.lambda_handler" ]

0 commit comments

Comments
 (0)