Skip to content

Commit 7c0ea24

Browse files
committed
chore(CRC-184): Try to make mermad-cli work in Docker
1 parent 33a84cc commit 7c0ea24

File tree

8 files changed

+167
-298
lines changed

8 files changed

+167
-298
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
!pnpm-lock.yaml
44
!bin/
55
!dist/
6+
!install-dependencies.sh

Dockerfile

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
# cspell: disable
2-
3-
FROM ghcr.io/puppeteer/puppeteer:22
4-
5-
USER root
1+
FROM node:22-alpine
2+
RUN corepack enable && corepack prepare [email protected] --activate
3+
WORKDIR /usr/src/app
64

7-
# Add user so we don't need --no-sandbox.
8-
RUN mkdir -p /home/pptruser/Downloads /app \
9-
&& chown -R pptruser:pptruser /home/pptruser \
10-
&& chown -R pptruser:pptruser /app
5+
ENV CHROME_BIN="/usr/bin/chromium-browser" \
6+
PUPPETEER_SKIP_DOWNLOAD="true"
7+
ADD install-dependencies.sh install-dependencies.sh
8+
RUN chmod 755 install-dependencies.sh && /bin/sh install-dependencies.sh
119

12-
# Run everything after as non-privileged user.
13-
USER pptruser
10+
RUN npm i -g [email protected] @mermaid-js/[email protected]
1411

15-
WORKDIR /usr/src/app
1612
COPY . .
1713

18-
ENTRYPOINT [ "/usr/local/bin/node", "/usr/src/app/bin/markdown-confluence-sync-action.js"]
14+
ENTRYPOINT [ "node", "/usr/src/app/bin/markdown-confluence-sync-action.js"]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ graph TD;
2424
A-->C;
2525
B-->D;
2626
C-->D;
27+
E-->F;
2728
```
2829

2930
## Features

dist/index.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

install-dependencies.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
# cspell: disable
4+
5+
# Install chromium and required fonts
6+
# available fonts https://wiki.alpinelinux.org/wiki/Fonts
7+
apk add chromium font-noto-cjk font-noto-emoji \
8+
terminus-font ttf-dejavu ttf-freefont ttf-font-awesome \
9+
ttf-inconsolata ttf-linux-libertine \
10+
&& fc-cache -f
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
docsDir: ".",
3+
mode: "id",
4+
filesPattern: "*.md",
5+
filesMetadata: [
6+
{
7+
path: "README.md",
8+
id: "337906332",
9+
title: "[Cross] [Markdown Confluence Sync] Github action",
10+
},
11+
{
12+
path: "CHANGELOG.md",
13+
id: "337906354",
14+
title: "[Cross] [Markdown Confluence Sync] [Github action] Releases",
15+
},
16+
],
17+
confluence: {
18+
url: "https://confluence.tid.es",
19+
spaceKey: "CTO",
20+
personalAccessToken: "MzIwMzkzNDYwODM5OhVoiRRF3E2OHs1sk5uXnrDXo53b",
21+
},
22+
logLevel: "debug",
23+
};

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
},
5858
"license": "Apache-2.0",
5959
"dependencies": {
60+
"@mermaid-js/mermaid-cli": "11.4.0",
61+
"mermaid": "11.5.0",
6062
"@actions/core": "1.11.1",
6163
"yaml": "2.6.1"
6264
},

0 commit comments

Comments
 (0)