forked from unavi-xyz/unavi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (30 loc) · 883 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
37
38
FROM node:18 AS builder
WORKDIR /app
# Prune files
RUN yarn global add turbo
COPY . .
RUN turbo prune --scope=host --docker
FROM node:18 AS installer
WORKDIR /app
# Install mediasoup dependencies
RUN \
set -x \
&& apt-get update \
&& apt-get install -y net-tools build-essential python3 python3-pip valgrind
# Install NPM dependencies
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/yarn.lock ./yarn.lock
RUN yarn install
# Build the project and its dependencies
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json
RUN yarn turbo build --filter=host...
FROM node:18 AS runner
WORKDIR /app
# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nodejs
USER nodejs
COPY --from=installer /app .
CMD node --experimental-specifier-resolution=node apps/host/build/server.js