-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
42 lines (33 loc) · 1 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
# Define function directory
ARG FUNCTION_DIR="/function"
FROM osgeo/gdal:ubuntu-small-3.6.2 as build-image
# Install aws-lambda-cpp build dependencies
RUN apt-get update && \
apt-get install -y \
g++ \
make \
cmake \
unzip \
libcurl4-openssl-dev \
python3-pip
# Include global arg in this stage of the build
ARG FUNCTION_DIR
# Create function directory
RUN mkdir -p ${FUNCTION_DIR}
# Copy function code
COPY src/index_safe/* ${FUNCTION_DIR}/
COPY ./requirements_for_lambda.txt .
# Install the runtime interface client
RUN pip install \
--target ${FUNCTION_DIR} \
-r requirements_for_lambda.txt
# Multi-stage build: grab a fresh copy of the base image
FROM osgeo/gdal:ubuntu-small-3.6.2
# 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 build image dependencies
COPY --from=build-image ${FUNCTION_DIR} ${FUNCTION_DIR}/
ENTRYPOINT [ "python", "-m", "awslambdaric" ]
CMD [ "app.handler" ]