# Build a SWISH image based on a recent SWISH+SWI-Prolog, plus an editor patch, using (always) http authentication, and preloading a Prolog file defining an "app": # docker build -t logicalcontracts/patchedswish . # Run for simple testing with (for example): # docker run -it -p 3051:3050 -v /Users/mc/git/TaxKB/swish/data:/data -v /Users/mc/git/TaxKB:/app -e LOAD='/app/swish/user_module_for_swish.pl' logicalcontracts/patchedswish # # For typical server configuration on Ubuntu: # docker run -d --restart always -p 8082:3050 -v /home/ubuntu/TaxKB_swish_data:/data -v /home/ubuntu/TaxKB:/TaxKB -e LOAD='/TaxKB/swish/user_module_for_swish.pl' -e SPACY_HOST=demo.logicalcontracts.com:8080 -e LOAD_KB=true -e SUDO=true logicalcontracts/patchedswish # make sure TaxKB_swish_data has permissions for group id 1024, e.g. something like: # sudo chown -R :1024 TaxKB_swish_data ; sudo chmod -R 775 TaxKB_swish_data ; sudo chmod -R g+s TaxKB_swish_data FROM logicalcontracts/swish-june2020 LABEL maintainer = "mc@interprolog.com" ENV SWISH_DIR /swish ENV SWISH_DATA /data ENV MY_USER swishpersona RUN addgroup --gid 1024 mygroup RUN useradd -m -g mygroup -s /bin/bash $MY_USER COPY --chown=swishpersona ./patches/prolog_server.js ${SWISH_DIR}/web/js/codemirror/mode/prolog/ # Now open to the public # RUN mkdir -p ${SWISH_DIR}/config-enabled && \ # cp ${SWISH_DIR}/config-available/auth_http_always.pl ${SWISH_DIR}/config-enabled/ # Swish likes to check existence of a /data directory: WORKDIR ${SWISH_DATA} ENTRYPOINT /usr/bin/swipl ${LOAD} ${SWISH_DIR}/daemon.pl --no-fork --port=3050 --user=$MY_USER --workers=16