-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
73 lines (50 loc) · 1.87 KB
/
Copy pathDockerfile
File metadata and controls
73 lines (50 loc) · 1.87 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
FROM node:12-alpine AS builder
ARG REGISTRY_URL
ARG REGISTRY_AUTH_TOKEN
RUN set -xe \
&& apk --no-cache upgrade \
&& apk --no-cache add alpine-sdk python2 libtool autoconf automake
RUN set -xe \
&& addgroup -g 1100 lisk \
&& adduser -h /home/lisk -s /bin/bash -u 1100 -G lisk -D lisk
COPY --chown=lisk:lisk . /home/lisk/lisk/
RUN if [ -n "$REGISTRY_URL" ]; then \
echo -e "registry=$REGISTRY_URL/\n${REGISTRY_URL#*:}/:_authToken=$REGISTRY_AUTH_TOKEN" >/home/lisk/.npmrc; \
fi
USER lisk
WORKDIR /home/lisk/lisk
RUN set -xe \
&& npm ci \
&& npm run build
RUN set -xe \
&& npm ci --production \
&& git rev-parse HEAD >REVISION \
&& rm -rf .git \
&& date --utc "+%Y-%m-%dT%H:%M:%S.000Z" >.build
FROM node:12-alpine
MAINTAINER Yuki Watanabe<watanabe@future-needs.com>
ENV NODE_ENV=production
ENV WFI_COMMIT=e34c502a3efe0e8b8166ea6148d55b73da5c8401
ENV WFI_SHA=0f75de5c9d9c37a933bb9744ffd710750d5773892930cfe40509fa505788835c
RUN set -xe \
&& apk --no-cache upgrade \
&& apk --no-cache add bash curl jq
RUN set -xe \
&& addgroup -g 1100 lisk \
&& adduser -h /home/lisk -s /bin/bash -u 1100 -G lisk -D lisk
COPY --from=builder --chown=lisk:lisk /home/lisk/lisk/ /home/lisk/lisk/
RUN set -xe \
&& mkdir -p /home/lisk/lisk/logs \
&& chown lisk:lisk /home/lisk/lisk/logs
ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/${WFI_COMMIT}/wait-for-it.sh /home/lisk/wait-for-it.sh
RUN if [ x"$( sha256sum /home/lisk/wait-for-it.sh |awk '{print $1}' )" = x"${WFI_SHA}" ]; then \
chmod 0755 /home/lisk/wait-for-it.sh; \
else \
rm -f /home/lisk/wait-for-it.sh; \
echo "Checksum verification failed."; \
exit 1; \
fi
USER lisk
WORKDIR /home/lisk/lisk
ENTRYPOINT ["node", "/home/lisk/lisk/dist/index.js"]
CMD ["-n", "mainnet"]