-
Notifications
You must be signed in to change notification settings - Fork 24
/
Dockerfile-calibre
49 lines (42 loc) · 1.42 KB
/
Dockerfile-calibre
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
# ==================================================================================================
#
# Docker gitbook helper image
#
# Provide gitbook commands in a docker image to build and deploy your docs.
#
# Helpful commands:
#
# Build the docker image:
# docker build --file Dockerfile-calibre -t desosa/calibre .
#
# Run bash in the image to call gitbook.
# docker run -p 4000:4000 -it -v ${CURDIR}:/gitbook -w /gitbook desosa/calibre bash
#
# Known issue: https://github.com/GitbookIO/gitbook/issues/1309
# Random complaints in gitbook build:
# Error: ENOENT: no such file or directory, stat '/gitbook/_book/gitbook/gitbook-plugin-fontsettings/fontsettings.js'
#
# To serve separately:
# cd _book; python -m SimpleHTTPServer 4002
#
# ==================================================================================================
# Base image, default node image
FROM node:8.4.0-slim
# Environment configuration
ENV GITBOOK_VERSION="3.2.3"
# Install gitbook and lftp
RUN npm install --global gitbook-cli \
&& gitbook fetch ${GITBOOK_VERSION} \
&& npm cache clear --force \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y lftp calibre \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*
# Current directory configuration
WORKDIR /gitbook
# Volume for gitbook operations
VOLUME /gitbook
# Ports for serve command
EXPOSE 4000 35729
# Default cmd is version display
CMD /usr/local/bin/gitbook -V