This repository has been archived by the owner on Dec 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
hopr-webserver.Dockerfile
86 lines (61 loc) · 1.74 KB
/
hopr-webserver.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# -- BASE STAGE --------------------------------
FROM node:12.9.1-buster AS base
WORKDIR /src
ENV YARN_VERSION 1.19.2
RUN yarn policies set-version $YARN_VERSION
COPY package*.json ./
COPY yarn.lock ./
RUN apt-get update && \
apt-get install -y \
libssl-dev \
ca-certificates \
fuse \
gcc \
cmake \
wget
RUN yarn install --build-from-source --frozen-lockfile
# -- CHECK STAGE --------------------------------
# FROM base AS check
# ARG CI
# ENV CI $CI
# COPY . .
# RUN yarn test
# -- BUILD STAGE --------------------------------
FROM base as build
COPY . .
RUN yarn build
RUN npm prune --production --no-audit
RUN yarn cache clean
# -- RUNTIME STAGE ------------------------------\
FROM node:12.9.1-buster AS runtime
# install envoy
RUN apt-get update && \
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common \
gettext
RUN curl -sL 'https://getenvoy.io/gpg' | apt-key add -
RUN apt-key fingerprint 6FF974DB
RUN add-apt-repository \
"deb [arch=amd64] https://dl.bintray.com/tetrate/getenvoy-deb $(lsb_release -cs) stable"
RUN apt-get update && apt-get install -y getenvoy-envoy
# install yarn
RUN yarn global add pm2
ENV NODE_ENV 'production'
WORKDIR /app
COPY --from=build /src/node_modules /app/node_modules
COPY --from=build /src/package.json /app/package.json
COPY --from=build /src/tsconfig.json /app/tsconfig.json
COPY --from=build /src/dist /app/dist
COPY --from=build /src/envoy/envoy.yaml.tmpl /app/envoy/envoy.yaml.tmpl
COPY --from=build /src/envoy/envoy.sh /app/envoy/envoy.sh
COPY --from=build /src/process.yaml /app/process.yaml
EXPOSE 9091
EXPOSE 50051
EXPOSE 8080
EXPOSE 8081
VOLUME ["/app/db"]
CMD ["pm2-runtime", "process.yaml"]