Home

Awesome

A SWISH (SWI-Prolog for SHaring) docker

This repository provides a Docker image for SWISH based on the official SWI-Prolog docker image.

Building the image

The image is built by running

make image

Running the image

The image may be used in many configurations, both controlled by docker options and options to the entry point. As basic operation typically already requires publishing ports and setting up a volume for the data, we added a bash script swish.sh that automates the common scenarios by providing docker run options from defaults and provided options. When called with -n, as in ./swish.sh -n option ..., it merery prints the docker command it will execute. The following options are processed:

All remaining options are passed to the entry point of the image.

Data

The docker image maintains its data (user programs and configuration) on the volume /data. This may be mapped to a host directory using the docker -v options (see also the --data=dir option of swish.sh).

Within the data directory, SWISH manages the following items:

Network access

The container creates a server at port 3050. By default this is an HTTP server. If run <docker options> swish --https is used, an HTTPS server is started.

The entry point

The entry point of the containser is /entry.sh, a shell script that initialises the data volume if needed and starts the server. It accepts the following options:

Configuration

The SWISH configuration is controlled by files in the config-enabled directory. Several commands may be used to control the configuration. These are executed as below:

docker run -it swish option ...

Multiple configuration options may be passed to update multiple facets of the configuration. Normally the image stops after updating the configuration. If --run is added the entry point starts the server after updating the configuration.

The options provided are: