This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 85
/
Dockerfile
65 lines (52 loc) · 2.07 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
56
57
58
59
60
61
62
63
64
65
##########################################################################
#
# Builder image:
# Runs module install and compiles TypeScript.
#
##########################################################################
FROM node:10 as builder
RUN mkdir -p /ethql
WORKDIR /ethql
# install global dependencies
COPY package.json yarn.lock ./
RUN yarn install
# COPY codebase
COPY . ./
# Install Lerna config
COPY lerna.json ./
RUN yarn bootstrap
# build all packages
RUN yarn build:ts
##########################################################################
#
# Production image:
# Contains only production dependencies and compiled JS.
#
##########################################################################
FROM node:10-alpine
RUN mkdir -p /ethql
WORKDIR /ethql
# copy dependencies (global AND package)
COPY --from=builder /ethql/node_modules ./node_modules
COPY --from=builder /ethql/package.json ./package.json
COPY --from=builder /ethql/lerna.json ./lerna.json
# copy package.json files (rarely changed)
COPY --from=builder /ethql/packages/base/package.json ./packages/base/
COPY --from=builder /ethql/packages/plugin/package.json ./packages/plugin/
COPY --from=builder /ethql/packages/core/package.json ./packages/core/
COPY --from=builder /ethql/packages/ens/package.json ./packages/ens/
COPY --from=builder /ethql/packages/erc20/package.json ./packages/erc20/
COPY --from=builder /ethql/packages/server/package.json ./packages/server/
# copy built packages
COPY --from=builder /ethql/packages/base/dist ./packages/base/dist
COPY --from=builder /ethql/packages/plugin/dist ./packages/plugin/dist
COPY --from=builder /ethql/packages/core/dist ./packages/core/dist
COPY --from=builder /ethql/packages/ens/dist ./packages/ens/dist
COPY --from=builder /ethql/packages/erc20/dist ./packages/erc20/dist
COPY --from=builder /ethql/packages/erc20/abi ./packages/erc20/abi
COPY --from=builder /ethql/packages/server/dist ./packages/server/dist
COPY packages/server/bin /ethql/packages/server/bin
RUN npx lerna link
ENTRYPOINT [ "node", "/ethql/packages/server/bin/ethql.js" ]
EXPOSE 4000
STOPSIGNAL 9