-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (29 loc) · 794 Bytes
/
Dockerfile
File metadata and controls
39 lines (29 loc) · 794 Bytes
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
FROM node:16-alpine AS base
FROM base AS pruner
ARG APP_NAME
# Install system-level components
RUN apk add --no-cache libc6-compat
RUN apk update
RUN npm install -g turbo npm@9.1.2
# Set working directory
WORKDIR /app
# Copy all files
COPY . .
# Prune everything but xi.front
RUN turbo prune --scope=${APP_NAME} --docker
FROM base
ARG APP_NAME
# Install system-level components
RUN apk add --no-cache libc6-compat openssh-client git
RUN apk update
RUN npm install -g npm@9.1.2
# Set working directory
WORKDIR /app
# Install all dependencies
COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/package-lock.json ./package-lock.json
RUN npm install
# Build the project
COPY --from=pruner /app/out/full/ .
COPY turbo.json turbo.json
RUN npm run build --filter=${APP_NAME}...