Skip to content

Commit

Permalink
Add dockerfile with gitbook and calibre
Browse files Browse the repository at this point in the history
  • Loading branch information
avandeursen committed Jul 24, 2018
1 parent c9db6c8 commit 44596ff
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions Dockerfile-calibre
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 44596ff

Please sign in to comment.