From 44596fffb0902d9ccb46a904ee9d7348ac54bfae Mon Sep 17 00:00:00 2001 From: Arie van Deursen Date: Tue, 24 Jul 2018 20:43:25 +0200 Subject: [PATCH] Add dockerfile with gitbook and calibre --- Dockerfile-calibre | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Dockerfile-calibre diff --git a/Dockerfile-calibre b/Dockerfile-calibre new file mode 100644 index 0000000..8a5f2df --- /dev/null +++ b/Dockerfile-calibre @@ -0,0 +1,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 \ No newline at end of file