-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (27 loc) · 950 Bytes
/
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
# ---- Dependencies ----
FROM node:16-alpine AS base
WORKDIR /usr/app
# ---- Dependencies ----
FROM base AS ts-compiler
COPY . ./
#build tezos-lib
RUN npm --prefix tezos-lib install
RUN npm --prefix tezos-lib run build
#build server
RUN npm --prefix server install
RUN npm --prefix server run build
FROM base as ts-remover
COPY --from=ts-compiler /usr/app/server/package*.json ./server/
COPY --from=ts-compiler /usr/app/server/lib ./server/
COPY --from=ts-compiler /usr/app/tezos-lib/package*.json ./tezos-lib/_dist/
COPY --from=ts-compiler /usr/app/tezos-lib/_dist ./tezos-lib/_dist/
RUN npm install --prefix tezos-lib/_dist --only=production
RUN npm install --prefix server --only=production
# ---- Release ----
FROM base as release
LABEL org.opencontainers.image.source=https://github.com/owneraio/finp2p-tezos-adapter
COPY --from=ts-remover /usr/app ./
RUN ls -la
ENV NODE_ENV=production
# define CMD
CMD [ "node", "./server/index.js" ]