H2CK / webtrees

Docker Image containing Webtrees
Apache License 2.0
36 stars 9 forks source link
docker-image webtrees

Build Webtrees Docker Pulls GitHub tag (latest by date)

docker-webtrees

webtrees is a free open source web-based genealogy application intended for collaborative use. It is compatible with standard 5.5.1-GEDCOM files. In this docker image based on phusion webtrees is provided. A database is not embedded in this image.

Since 12/07/19 version 2.0 is officially released and also provided by this repository as docker image.

This container now supports multiple architectures. That allows to run this image for example also on a Raspberry Pi. Please use the corresponding newly introduced image tags using the following syntax: <webtrees version>-<build version>-<architecture> Supported architectures are: amd64, arm32v7, arm64v8, i386, ppc64le, s390x

Usage

docker run -d -p 8088:8079 --name webtrees --link mysql:db -v /webtrees/data:/var/www/html/data -e GROUP_ID=999 -e PORT=8079 --restart always dtjs48jkt/webtrees

After starting the docker container go to:

https://server or https://server:port if you have defined an alternative port

Update Functionality

This docker image is based on Ubuntu. On each start of the container an update of the used Ubuntu packages could be performed. Due to the running update it might take a little longer until the application webtrees is available. This auto-update functionality has (now) to be activated explicitly (-e UPDATE_ON_START=TRUE).

Persistent storage of data

Configuration and media files should be stored outside the container. Therefor you should create a directories that is mapped to the container internal directory /var/www/html/data. In the container apache is running under user www-data [33] (group www-data[33]). The directory must therfore be read- and writable for this user. If this is not possible you can use the alternative and use the parameter GROUP_ID to inform the container about the group that has read and write access to those folders.

Database

The image does not contain a MySQL database. Instead you have to use a separate MySQL instance. For example you could use the MySQL Docker Image. Using the --link parameter a direct connection to the database in an other container could be established. If you use the --link parameter it is sufficient to set as database hostname db and port 3306. This can be set during the initial setup in the wizard or directly in the file config.ini.php (in data directory /var/www/html/data). The database user must have all access rights to create the necessary database and tables.

Logging

Log data of the contained web-server is written in the files in the folder /var/log/apache2/. If access to those files is necessary this location could be mapped to an external volume.

Port of Apache web server / Encryption

This image supports per default https based communication on port 443. Alternatively you can use this image also only using http, e.g. if you only use it within your home network.

Details on encryption

If it is necessary to change the default port (e.g. in case of collisions) you can set the optional parameter PORT to a different value. The https communication is based on a self signed certificate. It is possible to use an alternative certificate. Therfore you have to map the internal folder /crt to an external location. This folder should contain the two files webtrees.key (Key without password protection) und webtrees.crt (certificate). It is not possible to change further encryption settings from outside the container. If you want a more sofisticated encryption you should use a reverse proxy in front of the webtrees container.

Using http only

It is possible to use the image without https support. For that you have to start the container with the following environament variables set.

docker run -d -p 80:80 --name webtrees --link mysql:db -v /webtrees/data:/var/www/html/data -e DISABLE_SSL=TRUE -e PORT=80 --restart always dtjs48jkt/webtrees

Usage of additional 3rd party modules

It is possible to use additional 3rd party modules of webtrees with this container. To use such modules it is necessary to mount those folders containing the module into the following location -v /var/www/html/modules_v4/<modulexxx>

Using Pretty URLs

It is possible to use pretty urls with this image. You can set in the config.ini.php file the following attributes:

redirect_urls="1"
base_url="http://localhost"

When using pretty urls it is necessary to set also the base_url. Otherwise you will end up with an error "Too many redirects".

It is also possible to active pretty urls by using environment variables. You could set -e PRETTYURLS=TRUE and -e BASE_URL=http://localhost. This will set the necessary settings in the config.ini.php.

Automatic initialization of database

For MySQL or MariaDB it is possible to use an automatical initalization of the database within the application. User the parameters to DB* and WT* to set the corresponding values. To possible error of the initialization start the container in interactve mode using -it.

Support for PostgreSQL or SQLServer

This image contains now the necessary libraries to optionally also select PostgreSQL or SQLServer as db storage in the setup wizard.

Parameters

Versions