-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocs.Dockerfile
More file actions
51 lines (34 loc) · 1017 Bytes
/
docs.Dockerfile
File metadata and controls
51 lines (34 loc) · 1017 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
40
41
42
43
44
45
46
47
48
49
50
FROM node:22.8.0-alpine3.20 AS base
# CVEs
RUN apk upgrade libssl3 libcrypto3 libxml2
RUN npm install -g npm@10.9.2 && npm cache clean --force
RUN corepack enable
RUN corepack prepare yarn@stable --activate
FROM base AS sources
WORKDIR /app
COPY .yarnrc.yml ./
COPY .yarn ./.yarn
COPY package.json yarn.lock ./
COPY web/package.json ./web/
# We could optimize here but fumadocs needs the config file and all
# plugins to be loaded during npm ci since it looks for stuff
# in the post install script
COPY docs /app/docs
# Check if lockfile is up to date
RUN yarn install --mode=skip-build --immutable
RUN yarn workspaces focus docs
FROM sources AS dev
EXPOSE 3000
WORKDIR /app/docs
CMD ["yarn", "dev"]
FROM sources AS builder
WORKDIR /app/docs
RUN yarn build
FROM base AS prod
WORKDIR /app
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder --chown=nextjs:nodejs /app/docs/.next/standalone ./
USER nextjs
EXPOSE 3000
CMD ["node", "/app/docs/server.js"]