-
Notifications
You must be signed in to change notification settings - Fork 45
/
Dockerfile
55 lines (42 loc) · 1.63 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
FROM node:10-alpine AS builder
ARG REGISTRY_URL
ARG REGISTRY_AUTH_TOKEN
RUN apk --no-cache upgrade && \
apk --no-cache add alpine-sdk python2 libtool autoconf automake
RUN 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 npm ci && \
npm run build
RUN npm ci --production && \
git rev-parse HEAD >REVISION && \
rm -rf .git && \
date --utc "+%Y-%m-%dT%H:%M:%S.000Z" >.build
FROM node:10-alpine
ENV NODE_ENV=production
ENV WFI_COMMIT=e34c502a3efe0e8b8166ea6148d55b73da5c8401
ENV WFI_SHA=0f75de5c9d9c37a933bb9744ffd710750d5773892930cfe40509fa505788835c
RUN apk --no-cache upgrade && \
apk --no-cache add bash curl jq
RUN 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 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"]