Skip to content

Commit b1c5457

Browse files
michalharakalclaude
andcommitted
fix: fix Antora Docker image and playbook for local builds
- Install npm packages to /opt/antora (not /antora which gets volume-mounted over) - Set NODE_PATH=/opt/antora/node_modules so Antora finds extensions - Use /opt/antora/node_modules/.bin/antora as entrypoint (not npx) - Fix playbook content source url to /antora (git repo root) Verified locally: 19 HTML pages, 12 Mermaid SVG diagrams rendered via Chromium inside the container. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2df13cd commit b1c5457

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

docs/.docker/Dockerfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,28 @@ RUN apk add --no-cache chromium font-noto
1010
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser \
1111
PUPPETEER_SKIP_DOWNLOAD=true
1212

13-
WORKDIR /antora
14-
15-
# Install Antora + extensions + mermaid-cli in one layer
16-
RUN npm i --save-exact \
13+
# Install Antora + extensions to /opt/antora (not /antora which gets volume-mounted)
14+
WORKDIR /opt/antora
15+
RUN npm init -y && npm i --save-exact \
1716
@antora/cli@3.1 \
1817
@antora/site-generator@3.1 \
1918
asciidoctor-kroki@0.18 \
2019
@mermaid-js/mermaid-cli@11 \
2120
&& npm cache clean --force
2221

23-
# Mermaid-cli config: use installed Chromium, no sandbox (container)
22+
# Make installed modules visible when workdir is the mounted project
23+
ENV NODE_PATH=/opt/antora/node_modules
24+
25+
# Mermaid-cli config
2426
RUN echo '{ \
2527
"executablePath": "/usr/bin/chromium-browser", \
2628
"args": ["--no-sandbox", "--disable-gpu", "--disable-dev-shm-usage"] \
27-
}' > /antora/puppeteer-config.json
29+
}' > /opt/antora/puppeteer-config.json
2830

29-
# Pre-generate a simple diagram to warm up and verify the stack works
31+
# Verify mermaid works
3032
RUN echo 'graph TD; A-->B;' > /tmp/test.mmd \
31-
&& npx mmdc -i /tmp/test.mmd -o /tmp/test.svg -p /antora/puppeteer-config.json \
33+
&& npx mmdc -i /tmp/test.mmd -o /tmp/test.svg -p /opt/antora/puppeteer-config.json \
3234
&& rm /tmp/test.mmd /tmp/test.svg
3335

34-
ENTRYPOINT ["npx", "antora"]
36+
ENTRYPOINT ["/opt/antora/node_modules/.bin/antora"]
3537
CMD ["--stacktrace", "antora-playbook.yml"]

docs/antora-playbook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ site:
44

55
content:
66
sources:
7-
- url: .
7+
- url: /antora
88
start_path: docs
99
branches: HEAD
1010

0 commit comments

Comments
 (0)