| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This is a multi-architecture, up-to-date, Docker image for webtrees served over HTTP or HTTPS. This can be put behind a reverse proxy such as CloudFlare or Traefik, or run standalone.
If you want to jump right in, take a look at the provided docker-compose.yml.
There are many environment variables available to help automatically configure the container. For any environment variable you do not define, the default value will be used.
🚨 WARNING 🚨 These environment variables will be visible in the webtrees control panel under "Server information". Either lock down the control panel to administrators, or use the webtrees setup wizard.
| Environment Variable | Required | Default | Notes |
|---|---|---|---|
| PRETTY_URLS | No | None | Setting this to any value will enable pretty URLs. This can be toggled at any time. |
| HTTPS or SSL | No | None | Setting this to any value will enable HTTPS. In this case, you must mount a directory containing webtrees.crt and webtrees.key certificates to the directory /certs/. For example: -v ~/certs:/certs/ |
| HTTPS_REDIRECT or SSL_REDIRECT | No | None | Setting this to any value will enable a permanent 301 redirect to HTTPS . Leaving this off will allow webtrees to be accessed over HTTP, but not automatically redirected to HTTPS. |
| LANG | No | en-us | webtrees localization setting. This takes a locale code. Examples: https://wpastra.com/docs/complete-list-wordpress-locale-codes/ |
| BASE_URL | Yes | None | Base URL of the installation, with protocol. This needs to be in the form of http://webtrees.example.com |
| DB_TYPE | No | mysql | Database server type. See below for valid values. |
| DB_HOST | Yes | None | Database server host. |
| DB_PORT | No | 3306 | Database server port. |
| DB_USER or MYSQL_USER | No | webtrees | Database server username. |
| DB_PASS or MYSQL_PASSWORD | Yes | None | Database server password. |
| DB_NAME or MYSQL_DATABASE | No | webtrees | Database name. |
| DB_PREFIX | No | wt_ | Prefix to give all tables in the database. Set this to a value of "" to have no table prefix. |
| WT_USER | Yes | None | First admin account username. Note, this is only used the first time the container is run, and the database is initialized. |
| WT_NAME | Yes | None | First admin account full name. Note, this is only used the first time the container is run, and the database is initialized. |
| WT_PASS | Yes | None | First admin account password. Note, this is only used the first time the container is run, and the database is initialized. |
| WT_EMAIL | Yes | None | First admin account email. Note, this is only used the first time the container is run, and the database is initialized. |
Additionally, you can add _FILE to the end of any environment variable name, and instead that will read the value in from the given filename. For example, setting DB_PASS_FILE=/run/secrets/my_db_secret will read the contents of that file into DB_PASS.
If you don't want the container to be configured automatically (if you're migrating from an existing webtrees installation for example), simply leave the database (DB_) and webtrees (WT_) variables blank, and you can complete the setup wizard like normal.
webtrees recommends a MySQL (or compatible equivalent) database. You will need a separate container for this.
PostgreSQL and SQLite are additionally both supported by webtrees and this image, but are not recommended. This image does not support Microsoft SQL Server, in order to support multiple architectures. See issue: microsoft/msphpsql#441
If you want to use a SQLite database, set the following values:
If you want to use a PostreSQL database, set the following values:
All other values are just like a MySQL database.
The image mounts:
If you want to add custom themes or modules, you can also mount the /var/www/webtrees/modules_v4/ directory.
Example docker-compose:
volumes:
- app_data:/var/www/webtrees/data/
- app_media:/var/www/webtrees/media/
- app_themes:/var/www/webtrees/modules_v4/
---
volumes:
app_data:
driver: local
app_media:
driver: local
app_themes:
driver: localSee the link above for information about v1.7 webtrees.
To install a custom theme or module, the process is generally as follows:
docker exec -it webtrees_app_1 bash # connect to the running container
cd /var/www/webtrees/modules_v4/ # move into the modules directory
curl -L <download url> -o <filename> # download the file
# if module is a .tar.gz file
tar -xf <filename.tar.gz> # extract the tar archive https://xkcd.com/1168/
rm <filename.tar.gz> # remove the tar archive
# if module is a .zip file
apt update && apt install unzip # install the unzip package
unzip <filename.zip> # extract the zip file
rm <filename.zip> # remove the zip file
exit # disconnect from the containerThe image exposes port 80 and 443.
Example docker-compose:
ports:
- 80:80
- 443:443If you have the HTTPS redirect enabled, you still need to expose port 80. If you're not using HTTPS at all, you don't need to expose port 443.
ImageMagick is included in this image to speed up thumbnail creation. webtrees will automatically prefer it over gd with no configuration.
🚨 WARNING 🚨 If you use the 2.X.X or beta versions of webtrees, you will NOT be able to use the 1.X.X version again. The database schema between these versions are very different, and this is a one-way operation.
Each stable, legacy, beta, and alpha release version of webtrees produces a version-tagged build of the Docker container.
Example:
image: ghcr.io/nathanvaughn/webtrees:1.7.15Currently, the tags latest and latest-legacy are available for the latest stable and legacy versions of webtrees, respectively.
Example:
image: ghcr.io/nathanvaughn/webtrees:latest-legacyNew releases of the Dockerfile are automatically generated from upstream webtrees versions. This means a human does not vette every release. While I try to stay on top of things, sometimes breaking issues do occur. If you have any, please feel free to fill out an issue.
webtrees does not like running behind a reverse proxy, and depending on your setup, you may need to adjust some database values manually.
For example, if you are accessing webtrees via a reverse proxy serving content over HTTPS, but using this container with HTTP, you might need to make the following changes in your database:
mysql -u webtrees -p
use webtrees;
update wt_site_setting set setting_value='https://example.com/login.php' where setting_name='LOGIN_URL';
update wt_site_setting set setting_value='http://example.com/' where setting_name='SERVER_URL';
quit;For more info, see this.
This image is available from 3 different registries. Choose whichever you want:
The Dockerfile is heavily based off solidnerd/docker-bookstack.
| Back | FazBrowse Home | New Git URL |