-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
53 lines (36 loc) · 1.39 KB
/
Copy pathdockerfile
File metadata and controls
53 lines (36 loc) · 1.39 KB
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
ARG LAYER_NAME=lambda-layer-wdio
##########################################################################
# Build lambda layer for running webdriver.io
##########################################################################
FROM jensbodal/lambda-amazonlinux2:node10-chromedriver AS lambda-layer-wdio-builder
ARG LAYER_NAME
ENV LAYER_NAME ${LAYER_NAME}
RUN yum install -y zip
WORKDIR /opt/nodejs
RUN npm install \
--no-optional \
--no-package-lock \
@wdio/cli@5.11.10 \
@wdio/local-runner@5.11.10 \
@wdio/mocha-framework@5.11.0 \
chai@4.2.0 \
wdio-chromedriver-service@5.0.2
WORKDIR /opt
RUN zip -9 --filesync --recurse-paths --symlinks "${LAYER_NAME}.zip" "./" && \
mv "${LAYER_NAME}.zip" "/home"
WORKDIR /home
##########################################################################
# Use layer for running tests
##########################################################################
FROM jensbodal/lambda-amazonlinux2:node10-chromedriver AS wdio-test
COPY --from=lambda-layer-wdio-builder /opt /opt
WORKDIR /opt/nodejs
COPY ./wdio-files ./
ENTRYPOINT ["node", "start.js"]
##########################################################################
# lambci-node10
##########################################################################
FROM lambci/lambda:nodejs10.x AS lambci-node10-wdio-test
COPY --from=wdio-test /opt /opt
WORKDIR /opt/nodejs
ENTRYPOINT ["node", "start.js"]