-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (24 loc) · 1.07 KB
/
Dockerfile
File metadata and controls
35 lines (24 loc) · 1.07 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
FROM node:20-alpine AS builder
WORKDIR /src
COPY . .
RUN yarn workspaces focus @gear-js/api gear-idea-explorer gear-idea-common gear-idea-indexer-db gear-js
RUN yarn build:gear-idea-explorer
FROM node:20-alpine AS deps
WORKDIR /deps
COPY package.json .
COPY yarn.lock .
COPY .yarn .yarn
COPY .yarnrc.yml .
COPY apis/gear/package.json apis/gear/package.json
COPY idea/gear/common/package.json idea/gear/common/package.json
COPY idea/gear/explorer/package.json idea/gear/explorer/package.json
COPY idea/gear/indexer-db/package.json idea/gear/indexer-db/package.json
RUN yarn workspaces focus @gear-js/api gear-idea-explorer gear-idea-common gear-idea-indexer-db gear-js --production
FROM node:20-alpine
COPY --from=deps /deps /src
COPY --from=builder /src/apis/gear/lib /src/apis/gear/lib
COPY --from=builder /src/idea/gear/common/dist /src/idea/gear/common/dist
COPY --from=builder /src/idea/gear/explorer/dist /src/idea/gear/explorer/dist
COPY --from=builder /src/idea/gear/indexer-db/lib /src/idea/gear/indexer-db/lib
WORKDIR /src/idea/gear/explorer
CMD ["node", "dist/main.js"]