Skip to content

Archetype on Docker (updated 2021)

Geoffroy Noël edited this page Nov 3, 2021 · 4 revisions

Context

Archetype is now legacy framework which is no longer maintained by their authors at King's College London. It was designed to run natively on a Linux web server. This is the deployment model of all the instances created for the research projects that have funded the development of Archetype.

This model, also called 'native', uses a now deprecated software stack and lacks deployment documentation. It is possible for an engineer to deploy the code base hosted in this repository and run it on a legacy OS (e.g. Ubuntu 18) but this is not recommended, for obvious security reasons, and will require a lot of patience to configure it properly.

The alternative model is designed to run as a personal research instance on Docker. It is simpler to deploy on a personal computer because the entire legacy software stack is packaged & pre-configured into a single file that can be downloaded from Dockerhub. However the same warning applies about the security issues if such Docker instance is made public.

The docker version of Archetype is unconventional in the sense that it is made of a single image (and thus container) running all the services in the stack. This is a bad practice. It was designed that way for various reasons: convenience for the end users (less moving parts), lack of support for composition at the time this was done, ability to preserve a full application in a single, stand-alone, file.

A script is provided in the /build folder to create a zip from a Docker or Native instance. The zip file will contain all the project data & customisations and can be re-injected into a Docker instance and possibly a native instance.

Quick guide

Prerequisites

Install Docker on your machine: https://docs.docker.com/get-docker/

Install a new Archetype docker instance

From the command line:

mkdir -p ~/archetype && docker rm -f archetype; docker run -d --name archetype -v ~/archetype:/home/digipal/digipal_project:cached -p 9080:80 kingsdigitallab/archetype:2.5.1 && echo "Archetype running on http://localhost:9080"

Browse the instance

Point your browser to: http://localhost:9080 .

Packaging your project content

The following command will package all your Archetype content into a single file and leave it in the container.

docker exec archetype python build/zip_digipal_project.py

You can download it at:

http://localhost:9080/static/archetype.tar.gz

Restoring your package into a Docker instance

Stop the container. Completely remove the content of the digipal_project folder. Copy archetype.tar.gz into the folder. Restart the container.

Clone this wiki locally