docsify as a docker (moby) container.
docker-docsify can be used in several ways.
You can invoke the container as an executable directly:
$ docker run \
--port 3000:3000 \
--volume /path/to/docs:/usr/local/docsify \
littlstar/docker-docsifydocker-docsify set the working directory to /usr/local/docsify in
the container. This makes it easy to bind a local path on disk to the
container. By default the container executes docsify serve --port 3000 ..
You can use the image as a base in a Dockerfile:
FROM littlstar/docker-docsify
ADD /path/to/docs .An image can be built and then executed.
$ docker build -t mydocs .
$ docker run -p 3000:3000 mydocs # server running on localhost:3000docker-docsify can be built with custom settings. This is useful for
things like enabling ssr. The ./configure
script in this repository generates a Dockerfile and Makefile.
Clone this repository before continuing.
You should have the docker command available in your $PATH before
you can generate a Dockerfile or Makefile.
docker-docsify can be configured by executing the ./configure script
in the familiar way. It accepts several flags that allow you to
configure the way docker-docsify is built and used.
Below is a list of flags and options that can be given to the ./configure
script used to generate the Dockerfile and Makefile suitable to build the image.
-h, --help Print this message
-V, --version Output version
--debug=[DEBUG] Configures the DEBUG environment variable for the Docker container
--prefix=PREFIX Docsify docker working directory path (default: /usr/local/docsify)
--port=PORT Server port exposed by Docker and the Docsify server should listen on (default: 3000)
--ssr Enable SSR server
--docsify-default-path=PATH The default docsify path when starting the server (defualt: .)
--docsify-version=VERSION Docsify (CLI) version to use (default: latest)
--docsify-module=NAME The module name to install from name (default: docsify-cli)
--docker-base=IMAGE The base docker image to base the docker build from (default: node)
--docker-bin=PATH The path to the docker binary (default: /usr/bin/docker)
--docker-tag=TAG The Docker tag to use when building the container (default: littlstar/docsify)
--docker-file=PATH The Dockerfile path (default: Dockerfile)
--docker-flags=" ...FLAGS" A space separated list of flags to pass to `docker build'
--node-version=VERSION Node.js version to use (default: latest)
The ./configure script generates template files from any file found in the
same directory with a .in extension. This could be useful for generating
intermediate files that leverage the same configuration information given to
all template files like Dockerfile.in and Makefile.in.
Below are the available template variables in the ./configure script.
They can be accessed in a template (.in) file with the syntax
@VARIABLE_NAME@.
OS "Operating System"
DEBUG "An optional DEBUG environment variable"
PREFIX "Default installation prefix"
SERVER_PORT "The server port to listen on"
NODE_VERSION "The base Node.js container version"
DOCKER "Docker binary path"
DOCKER_TAG "Docker build tag"
DOCKER_BASE "Docker base image"
DOCKER_FILE "Dockerfile path"
DOCKER_FLAGS "Docker build flags"
VERSION_MAJOR "The major version of the docker container"
VERSION_MINOR "The minor version of the docker container"
VERSION_PATCH "The patch version of the docker container"
VERSION_REVISION "The revision version of the docker container"
DOCSIFY_VERSION "The docsify-cli version to use"
DOCSIFY_CLI_NAME "The command line program name to invoke"
DOCSIFY_CLI_COMMAND "The docsify-cli command to use"
DOCSIFY_CLI_MODULE_NAME "The module name to install from npm"
DOCSIFY_CLI_DEFAULT_PATH "The default path for the docsify-cli command"The container can be built with make. You may need to invoke with
sudo
$ make buildThe container can be removed with the clean target.
$ make cleanThe docker container outlined by the Dockerfile contains labels, defines
environment variables, exposes ports, sets a working directory, and has
an entry point with default arguments.
The following labels are exposed in the docker container:
The major version of the docker container.
label docker_docsify_version_major="@VERSION_MAJOR@"The minor version of the docker container.
label docker_docsify_version_minor="@VERSION_MINOR@"The patch version of the docker container.
label docker_docsify_version_patch="@VERSION_PATCH@"The revision version of the docker container.
label docker_docsify_version_revision="@VERSION_REVISION@"The major, minor, patch, and revision versions concatenated with ..
label docker_docsify_version="@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@.@VERSION_REVISION@"The HTTP server port docsify listens on.
EXPOSE @SERVER_PORT@ # default: 3000
The working directory of the container.
workdir @PREFIX@
The entry point of the image can be changed if configured with --ssr
enabling SSR mode (see below).
Entry point to start a static server from generated documentation.
entrypoint [ "@DOCSIFY_CLI_NAME@", "serve", "--port", "@SERVER_PORT@" ]
Entry point to start a SSR server.
entrypoint [ "@DOCSIFY_CLI_NAME@", "start", "--port", "@SERVER_PORT@" ]
The following environment variables are defined in the container.
An environment variable that is intended for modules like debug.
This can be configured with the --debug=DEBUG flag for the ./configure
script.
env DEBUG @DEBUG@ # default: DEBUG=docsify:*
The HTTP server port docsify listens on.
This can be configured with the --port=PORT flag for the ./configure
script.
env PORT @SERVER_PORT@ # default: PORT=3000
The version of docsify-cli to use.
This can be configured with the --docsify-version=VERSION flag for the
./configure script.
env DOCSIFY_VERSION @DOCSIFY_VERSION@ # default: DOCSIFY_VERSION=latest
The version of node to use.
This can be configured with the --node-version=VERSION flag for the
./configure script.
env NODE_VERSION @NODE_VERSION@ # default: NODE_VERSION=latest
MIT