You need to create a location for persistent storage. Because containers are stateless, the data has to live outside the image. For example,
You will need to decide on the name you’re going to use for your Haplo installation. On a server, register a name in DNS so that clients can connect to your server. This can either be the name of the server you’re going to install Haplo on, or an alias (CNAME). For example, if you want your Haplo installation to be available at the URL:
then you need to create a DNS entry for
If you’re using a Mac, then edit
/private/etc/hosts to add
haplo.your.site.name as an alias for 127.0.0.1.
This name will also be used in the configuration file below.
In the location for persistent storage you created above, create a file called
app.values that looks like the following, defining the five settings required to bootstrap the installation.
APPURL="haplo.your.site.name" APPNAME="Fred" APPUNAME="Fred Bloggs" APPUMAIL="email@example.com" APPUPASS="fred123"
The values required are:
There is an additional value you can set, which is optional.
If this is set, then the application will have the specified plugin installed. If unset, you’ll get a basic uncustomized Haplo application. At the present time, the only valid value is “hresrepodemo_application”, which will cause a demonstration Academic Repository to be created.
With the initial configuration ready, run the Haplo Docker image. You need to map network ports and the persistent storage.
docker run -p 80:8080 -p 443:8443 -v ~/haplo-data:/haplo haploorg/haplo-app
This will download the Haplo image, map the network ports 80 (for http) and 443 (for https), and mount your persistent storage in the correct place inside the container.
The first time you run the container, it will take a little while to populate the database, create a self-signed certificate, set up an application, and start the application server. You can then go to
in your web browser and log in using the email address and password details you put in the configuration. (You will get a security warning from your web browser due to the use of a self-signed certificate.)
Subsequent runs of the container will just load the data from the persistent storage, and won’t need the initialization step. Once configured, you can go and delete the
If you’re interested in seeing how the Docker image is built, then you can look at the original source and Dockerfiles here: https://github.com/haplo-org/haplo-docker