-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (26 loc) · 675 Bytes
/
Dockerfile
File metadata and controls
41 lines (26 loc) · 675 Bytes
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
ARG FUNCTION_DIR="/function"
FROM python:3.8 as build-image
RUN apt-get update && \
apt-get install -y \
g++ \
make \
cmake \
unzip \
libcurl4-openssl-dev
ARG FUNCTION_DIR
RUN mkdir -p ${FUNCTION_DIR}
RUN pip install \
--target ${FUNCTION_DIR} \
awslambdaric
RUN mkdir -p /tmp/deps
COPY requirements.txt /tmp/deps
RUN pip install \
--target ${FUNCTION_DIR} \
-r /tmp/deps/requirements.txt
COPY . ${FUNCTION_DIR}
FROM python:3.8-slim
ARG FUNCTION_DIR
WORKDIR ${FUNCTION_DIR}
COPY --from=build-image ${FUNCTION_DIR} ${FUNCTION_DIR}
ENTRYPOINT [ "/usr/local/bin/python", "-m", "awslambdaric" ]
CMD [ "lambda.handler" ]