xoxys.freshrss/templates/systemd/user/freshrss-container.service.j2

66 lines
1.8 KiB
Plaintext
Raw Normal View History

2022-03-20 15:12:57 +00:00
#jinja2:lstrip_blocks: True
{{ ansible_managed | comment }}
[Unit]
Description=FreshRSS App Server
Wants=network.target network-online.target
After=network-online.target
2022-06-28 20:52:45 +00:00
RequiresMountsFor=%t/containers
2022-03-20 15:12:57 +00:00
Requires=dbus.socket
BindsTo={{ __freshrss_pod_name }}.service
After={{ __freshrss_pod_name }}.service
[Service]
2022-04-10 15:22:57 +00:00
Type=notify
NotifyAccess=all
2022-03-20 15:12:57 +00:00
Environment=PODMAN_SYSTEMD_UNIT=%N
SyslogIdentifier=%N
LogExtraFields=CONTAINER_NAME=%N
Delegate=memory pids
2022-06-28 20:52:45 +00:00
Restart=on-failure
TimeoutSec=70
2022-03-20 15:12:57 +00:00
ExecStartPre=/usr/bin/podman pod exists {{ __freshrss_pod_name }}
2022-06-28 20:52:45 +00:00
ExecStart=/usr/bin/podman run \
2022-03-20 15:12:57 +00:00
--rm \
2022-06-28 20:52:45 +00:00
--replace \
--detach \
2022-03-20 15:12:57 +00:00
--restart=no \
2022-06-28 20:52:45 +00:00
--cgroups=no-conmon \
--sdnotify=conmon \
2022-03-20 15:12:57 +00:00
--env-file={{ __freshrss_systemd_env_dir }}/freshrss.env \
--pod {{ __freshrss_pod_name }} \
{% if freshrss_memory_limit is defined %}
--memory={{ freshrss_memory_limit }} \
{% endif %}
{% if freshrss_memory_reservation is defined %}
-memory-reservation={{ freshrss_memory_reservation }} \
{% endif %}
{% if freshrss_cpu_quota is defined %}
--cpu-quota={{ freshrss_cpu_quota }} \
{% endif %}
{% for item in freshrss_security_opt %}
--security-opt={{ item }} \
{% endfor %}
{% for item in freshrss_cap_add %}
--cap-add={{ item }} \
{% endfor %}
{% for item in freshrss_cap_drop %}
--cap-drop={{ item }} \
{% endfor %}
--pids-limit={{ freshrss_pids_limit }} \
{% for volume in freshrss_volumes %}
--mount 'type={{ volume.type | default("volume") | lower }},src={{ volume.name }},target={{ volume.dest }}' \
{% endfor %}
--name={{ __freshrss_container_name }} \
{{ freshrss_image }}
2022-06-28 20:52:45 +00:00
ExecStop=/usr/bin/podman stop --ignore {{ __freshrss_container_name }}
2022-03-20 15:12:57 +00:00
ExecStopPost=/usr/bin/podman rm --force --ignore {{ __freshrss_container_name }}
[Install]
WantedBy=multi-user.target default.target