-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
60 lines (46 loc) · 1.13 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
# Define custom function directory
ARG FUNCTION_DIR="/function"
FROM node:14-alpine3.12 as build-image
# Include global arg in this stage of the build
ARG FUNCTION_DIR
RUN apk add --update-cache \
build-base \
libtool \
libressl-dev \
musl-dev \
libffi-dev \
autoconf \
automake \
libexecinfo-dev \
make \
cmake \
python3 \
py3-pip \
libcurl
# Create function directory
RUN mkdir -p ${FUNCTION_DIR}
WORKDIR ${FUNCTION_DIR}
# Copy package json
COPY package.json ${FUNCTION_DIR}
# Install the function's dependencies
RUN npm install --production
# Copy function code
COPY app.js ${FUNCTION_DIR}
FROM node:14-alpine3.12
# Installs latest Chromium package.
RUN apk add --no-cache \
chromium \
nss \
freetype \
freetype-dev \
harfbuzz \
ca-certificates \
ttf-freefont
# 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}
ENTRYPOINT ["/usr/local/bin/npx", "aws-lambda-ric"]
CMD ["app.handler"]