-
Notifications
You must be signed in to change notification settings - Fork 26
/
Dockerfile
43 lines (34 loc) · 1.32 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
FROM node:slim AS builder
WORKDIR /disco
COPY package*.json .
COPY isomorphic-wrtc/package.json isomorphic-wrtc/
COPY discojs/package.json discojs/
COPY discojs-node/package.json discojs-node/
COPY server/package.json server/
RUN npm ci
COPY isomorphic-wrtc/ isomorphic-wrtc/
COPY discojs/ discojs/
COPY discojs-node/ discojs-node/
COPY tsconfig.base.json .
RUN npm --workspace=discojs --workspace=discojs-node run build
COPY server/ server/
RUN cd server/ && npm run build
# TODO freeze to 22 until tfjs#8425 is merged
FROM node:22-slim AS runner
WORKDIR /disco
COPY --link --from=builder /disco/package*.json /disco/
COPY --link --from=builder /disco/isomorphic-wrtc/package.json isomorphic-wrtc/
COPY --link --from=builder /disco/discojs/package.json discojs/
COPY --link --from=builder /disco/discojs-node/package.json discojs-node/
COPY --link --from=builder /disco/server/package.json server/
RUN npm --workspace=isomorphic-wrtc \
--workspace=discojs \
--workspace=discojs-node \
--workspace=server \
--omit=dev ci
COPY --link --from=builder /disco/isomorphic-wrtc/node.js isomorphic-wrtc/
COPY --link --from=builder /disco/discojs/dist/ discojs/dist/
COPY --link --from=builder /disco/discojs-node/dist/ discojs-node/dist/
COPY --link --from=builder /disco/server/dist/ server/dist/
WORKDIR server
CMD ["node", "dist/main.js"]