Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docusaurus/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# Local development files
node_modules
**/yarn.lock
3 changes: 0 additions & 3 deletions docusaurus/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,4 @@
**/*.log
**/*.swp

# Ignore any package-lock or yarn.lock if using a different package manager
# Uncomment the one you're not using
**/yarn.lock
**/package-lock.json
12 changes: 7 additions & 5 deletions docusaurus/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# The slim version is based on a small Debian image.
FROM node:26-slim AS base
ENV FORCE_COLOR=0
# Bootstrap Yarn Classic (corepack is unbundled from Node 25+); yarn manages all project deps.
RUN npm install -g yarn@1.22.22
WORKDIR /opt/docusaurus

# Documentation contents from readmes/ (via additional_contexts)
Expand All @@ -28,35 +30,35 @@ COPY versioned_sidebars versioned_sidebars

# Configuration files
COPY docusaurus.config.js .
COPY package.json package-lock.json* ./
COPY package.json yarn.lock ./
COPY sidebars.js .
COPY sidebars.json .
COPY test.js .
COPY versions.json .

WORKDIR /opt/docusaurus
RUN [ ! -d "node_modules" ] && npm install --package-lock-only && npm ci
RUN [ -d "node_modules" ] || yarn install --frozen-lockfile

#==================================================================
# Local deployment
#==================================================================
FROM base AS dev
EXPOSE 3000
CMD ["npm", "run", "start", "--", "--poll", "1000"]
CMD ["yarn", "start", "--poll", "1000"]

#==================================================================
# Base image for production deployment
#==================================================================
FROM base AS prod
ENV NODE_OPTIONS="--max-old-space-size=4096"
RUN npm run build
RUN yarn build

#==================================================================
# Production deployment
#==================================================================
FROM prod AS serve
EXPOSE 3000
CMD ["npm", "run", "serve", "--", "--no-open"]
CMD ["yarn", "serve", "--no-open"]

#==================================================================
# Production deployment with Caddy automatic SSL/TLS
Expand Down
13 changes: 13 additions & 0 deletions docusaurus/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ services:
- caddy_data:/data
- caddy_config:/config

# Regenerate docusaurus/yarn.lock after changing package.json
# docker compose run --rm lockgen
lockgen:
image: node:26-slim
working_dir: /tmp
volumes:
- .:/out
command: >
sh -c "npm install -g yarn@1.22.22 &&
cp /out/package.json . &&
yarn install &&
cp yarn.lock /out/yarn.lock"

volumes:
caddy_data:
caddy_config:
3 changes: 3 additions & 0 deletions docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"@docusaurus/module-type-aliases": "^3.10.0",
"@docusaurus/types": "^3.10.0"
},
"resolutions": {
"uuid": "^11.0.0"
},
"browserslist": {
"production": [
">0.5%",
Expand Down
Loading
Loading