-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dockerfile with gitbook and calibre
- Loading branch information
1 parent
c9db6c8
commit 44596ff
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |