-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
47 lines (35 loc) · 942 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
39
40
41
42
43
44
45
46
47
##############################
## Building
##############################
FROM node:20-alpine as builder
# RUN apk update && apk upgrade
# Set working directory
WORKDIR /usr/src/app
# Set npm loglevel
ENV NPM_CONFIG_LOGLEVEL=warn
# Copy "package.json" and "package-lock.json" before other files
# Utilise Docker cache to save re-installing dependencies if unchanged
COPY ./package*.json ./
COPY ./yarn.lock ./
COPY ./.yarnrc.yml ./
COPY ./.yarn ./.yarn
COPY ./packages ./packages
# Install dependencies
RUN yarn install --immutable
# Copy all files
COPY ./ ./
# Set node env
ENV NODE_ENV=production
ENV BASE_URL=/
# Build app
RUN yarn docs:build
#RUN yarn build
##############################
## Running
##############################
FROM halverneus/static-file-server:v1.8.11
# Set working directory
WORKDIR /usr/src/app
# Set folder
ENV FOLDER=/usr/src/app/web
COPY --from=builder /usr/src/app/components/.vitepress/dist ./web