-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdokuwiki.service
41 lines (39 loc) · 1.63 KB
/
dokuwiki.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#
# This systemd unit starts a Dokuwiki instance using podman.
# Most parts of this file come from podman-generate-systemd.
#
[Unit]
Description=Dokuwiki instance
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
# All configuration is saved inside the environment file including:
# - DOKUWIKI_IMAGE: the podman/docker image to rung
# - TCP_PORT, TCP_PORTS: the random ports assigned by system
EnvironmentFile=%S/state/environment
EnvironmentFile=-%S/state/discovery_ldap.env
WorkingDirectory=%S/state
Restart=always
ExecStartPre=/usr/local/bin/runagent discover-ldap
ExecStartPre=/usr/local/bin/runagent write-ldap-conf
ExecStartPre=/bin/rm -f %t/dokuwiki.pid %t/dokuwiki.ctr-id
# Podman should bind only to 127.0.0.1:TCP_PORT
# Data are persistend inside dokuwiki-data volume
ExecStart=/usr/bin/podman run --conmon-pidfile %t/dokuwiki.pid \
--cidfile %t/dokuwiki.ctr-id \
--cgroups=no-conmon \
--replace --name dokuwiki -d \
--env-file=%S/state/environment \
--publish 127.0.0.1:${TCP_PORT}:8080 \
--volume dokuwiki-data:/storage:z \
--network=slirp4netns:allow_host_loopback=true \
--add-host=accountprovider:10.0.2.2 \
${DOKUWIKI_IMAGE}
ExecStartPost=/usr/local/bin/runagent wait-after-boot
ExecStartPost=podman cp ./dokuwiki-config/local.protected.php dokuwiki:/bitnami/dokuwiki/conf/local.protected.php
ExecStartPost=podman cp ./dokuwiki-config/plugins.local.php dokuwiki:/bitnami/dokuwiki/conf/plugins.local.php
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/dokuwiki.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/dokuwiki.ctr-id
PIDFile=%t/dokuwiki.pid
Type=forking
[Install]
WantedBy=default.target