From 3e898b4112ca0784fbf181e55d8e4fbdc3e5202b Mon Sep 17 00:00:00 2001 From: Merijn Wijngaard Date: Wed, 26 Nov 2025 14:22:02 +0100 Subject: [PATCH] Pre-create backups dir to support volume/bind mount. --- Dockerfile | 4 +++- README.md | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 08087eb..00ce06b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -80,7 +80,9 @@ ENV ASSEMBLER $FUSEKI_BASE/configuration/assembler.ttl COPY assembler.ttl $ASSEMBLER ENV CONFIG $FUSEKI_BASE/config.ttl COPY fuseki-config.ttl $CONFIG -RUN mkdir -p $FUSEKI_BASE/databases +RUN mkdir -p \ + $FUSEKI_BASE/backups \ + $FUSEKI_BASE/databases # Set permissions to allow fuseki to run as an arbitrary user RUN chgrp -R 0 $FUSEKI_BASE \ diff --git a/README.md b/README.md index 8068751..50b5dcf 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ Note: if you wish to add new datasets using the Fuseki admin UI - and persist th Note 2: if you have the `assembler.ttl` file on a bind mount, using environment variables to enable Fuseki's endpoints (for writing data; see the Run section for details), e.g. `ENABLE_DATA_WRITE`, is not encouraged. Using both bind mount for the `assembler.ttl` file and e.g. `ENABLE_DATA_WRITE=true` causes a problem related to file permissions (`sed: couldn’t open temporary file /fuseki-base/configuration/sedXXX: Permission denied`) (which can be solved by either running the container as the root user or giving write permissions to the host directory that is mounted to the container; at least on Linux). The recommended way when having the `assembler.ttl` file on a bind mount is to edit the `assembler.ttl` file by hand to enable endpoints. +Note 3: if you wish to support persistent backups, you also need to use volume/bind mount for the directory `/fuseki-base/backups`. In containerized production environments, you might want to consider sharing this volume with a sidecar like [atmoz/sftp](https://hub.docker.com/r/atmoz/sftp), so backups can be moved offsite using something like [rclone](https://rclone.org/). + **Note on running in OpenShift**, if you use this image as a parent image (e.g. use your own Dockerfile to load the data inside the image using TDBLOADER): as containers are run as an arbitrary user, you'll have to ensure the write permission on the TDB and index directories, e.g. by adding the following lines in your Dockerfile after the tdbloader and indexing commands: ```