This repository has been archived on 2023-02-05. You can view files and clone it, but cannot push or open issues or pull requests.
pyinfra-photoprism/templates/systemd-run.sh.j2
2021-09-27 21:38:10 +09:00

16 lines
741 B
Django/Jinja

#!/usr/bin/env bash
set -euo pipefail
systemd-run \
--pty \
--unit='photoprism-run' \
--description='photoprism binary call' \
--property=User={{ host.data.unix_user }} \
--property=Group={{ host.data.unix_group }} \
--property=StateDirectory={{ host.data.unix_user }} \
--property=EnvironmentFile={{ host.data.systemd_env }} \
--property=WorkingDirectory=/photoprism \
--property=RootDirectory={{ host.data.undocker_dst }} \
--property='BindPaths={{ host.data.photoprism_storage_src }}:/photoprism/storage {{ host.data.photoprism_originals_src }}:/photoprism/originals {{ host.data.photoprism_import_src }}:/photoprism/import' \
--property='BindReadOnlyPaths=/etc/resolv.conf /proc' \
/photoprism/bin/photoprism $1