-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (44 loc) · 1.99 KB
/
Copy pathDockerfile
File metadata and controls
56 lines (44 loc) · 1.99 KB
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
51
52
53
54
55
56
FROM node:20-slim
LABEL maintainer="andycrusoe@gmail.com"
LABEL repository="https://github.com/appotry/docker-gitbook"
LABEL homepage="https://blog.17lai.site"
LABEL com.github.actions.name="build-gitbook"
LABEL com.github.actions.description="build or deplay your gitbook"
LABEL com.github.actions.icon="book-open"
LABEL com.github.actions.color="white"
ENV TZ=Asia/Shanghai
ENV QTWEBENGINE_DISABLE_SANDBOX=1
ENV NPM_CONFIG_LOGLEVEL=info
ENV NPM_CONFIG_REGISTRY=""
# 系统运行时依赖:PlantUML / Calibre / CJK 字体
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates curl git \
openjdk-17-jre-headless calibre graphviz \
fonts-noto fonts-noto-cjk locales-all \
&& strip --remove-section=.note.ABI-tag \
/usr/lib/$(dpkg-architecture -q DEB_HOST_MULTIARCH)/libQt5Core.so.5 || true \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# GitBook CLI + Honkit + 工具
RUN export PUPPETEER_SKIP_DOWNLOAD='true' && \
npm install -g gitbook-cli honkit svgexport && \
if [ -f /usr/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js ]; then \
sed -i 's/fs.stat = statFix(fs.stat)/\/\/fs.stat = statFix(fs.stat)/g' \
/usr/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js && \
sed -i 's/fs.fstat = statFix(fs.fstat)/\/\/fs.fstat = statFix(fs.fstat)/g' \
/usr/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js && \
sed -i 's/fs.lstat = statFix(fs.lstat)/\/\/fs.lstat = statFix(fs.lstat)/g' \
/usr/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js; \
fi && \
gitbook --version 2>/dev/null || true && \
honkit --version && \
npm cache clean --force
ENV BOOKDIR=/gitbook
VOLUME $BOOKDIR
EXPOSE 4000
WORKDIR $BOOKDIR
COPY book.json /book.json
COPY entrypoint.sh /entrypoint.sh
COPY userRun.sh /userRun.sh
RUN chmod +x /entrypoint.sh /userRun.sh
CMD ["gitbook", "--help"]