-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (27 loc) · 1007 Bytes
/
Dockerfile
File metadata and controls
32 lines (27 loc) · 1007 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
FROM node:22 AS dev
WORKDIR /app
COPY package.json yarn.lock ./
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install
FROM dev AS build
# Stable and large — cache early
COPY static static
# Changes on version releases
COPY versioned_sidebars versioned_sidebars
COPY versioned_docs versioned_docs
# Config files — occasional changes
COPY sidebarTutorials.js sidebars.js versions.json docusaurus.config.js ./
# Theme/component code — changes less often than content
COPY src/components src/components
COPY src/icons src/icons
COPY src/pages src/pages
COPY src/styles src/styles
COPY src/theme src/theme
COPY src/tutorials src/tutorials
# Content changes most frequently — last so all layers above stay cached
COPY src/content src/content
RUN --mount=type=cache,target=/app/node_modules/.cache/webpack \
--mount=type=cache,target=/app/.docusaurus \
yarn build
FROM bitnami/nginx AS prod
COPY nginx/index.html /app
COPY --from=build /app/build/docs /app/docs