A simple web viewer for browsing we1s model visualizations published as HTML+JavaScript websites. Empty directories on the site are auto-indexed in order to make it easy to publish visualization sites into many site subdirectories and navigate them on-the-fly.
Tested with dfr-browser and topic-bubbles site output.
The viewer is packaged as a Docker container running the nginx webserver on an Alpine Linux virtual machine. Based on a configuration of an nginx official image.
While it is possible to run this container and serve web contents from a mounted volume using docker run -v myvolume
, this container is designed to be linked to other containers by running docker compose
or docker swarm
in the same directory with a valid docker-compose.yml
or docker-cloud.yml
file that specifies their shared volumes.
Specifically, in the we1s-cloud this container mounts as read-only a volume that is also mounted by the we1s-notebook Jupyter Notebook environment. Notebooks can then write visualization outputs to that volume in order to publish them to the web.
For more details, see we1s-cloud.
A simple Docker swarm example is given in docker-cloud.yml
.
docker swarm init
docker stack deploy --compose-file docker-cloud.yml we1s
This will download two pre-built images from Docker Hub for a notebook and this notebook-viewer, then launch two containers and mount a shared volume between them. The Jupyter notebook is available on port 8888, the web viewer on port 10002.
Files saved to the to the shared volume from the Jupyter notebook environment at ~/work/view
will be web viewable on port 10002.
To customize this viewer:
-
download or
git clone https://github.com/whatevery1says/we1s-notebook-viewer.git
-
make changes as needed, e.g. to configuration file:
nginx.vh.default.conf
-
build a local image and name it:
docker build we1s-notebook-viewer .
-
alter the
docker-cloud.yml
file to point to the new local imageimage: we1s-notebook-viewer
-
launch the stack on Docker:
docker swarm init docker stack deploy --compose-file docker-cloud.yml we1s
Based on the official nginx docker image, version pinned.
It has been modified:
- autoindex is enabled for full directory navigation