diff --git a/Dockerfile b/Dockerfile index 2e1e946b..58fdbc78 100644 --- a/Dockerfile +++ b/Dockerfile @@ -129,8 +129,9 @@ RUN fc-cache -f && \ mkdir -p /app/logs /app/artifacts /app/data && \ chown -R easyflow:easyflow /app +COPY docker-soffice-wrapper.sh /usr/local/bin/soffice COPY docker-entrypoint.sh /usr/local/bin/easyflow-entrypoint.sh -RUN chmod 755 /usr/local/bin/easyflow-entrypoint.sh +RUN chmod 755 /usr/local/bin/soffice /usr/local/bin/easyflow-entrypoint.sh VOLUME ["/app/logs", "/app/data"] EXPOSE 8111 diff --git a/docker-soffice-wrapper.sh b/docker-soffice-wrapper.sh new file mode 100644 index 00000000..9093b8c0 --- /dev/null +++ b/docker-soffice-wrapper.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env sh +set -eu + +profile_parent="${TMPDIR:-/tmp}" +profile_dir="$(mktemp -d "${profile_parent%/}/easyflow-soffice-XXXXXX")" + +cleanup() { + rm -rf -- "$profile_dir" +} + +trap cleanup EXIT HUP INT TERM + +/usr/bin/soffice \ + -env:UserInstallation="file://${profile_dir}" \ + --headless \ + --safe-mode \ + --nologo \ + --nodefault \ + --nolockcheck \ + --norestore \ + "$@"