coreos-home-server/config/service/dovecot/systemd/dovecot.service
Alex Palaistras fb7d7eaa22 Use podman run instead of create && start
And correctly remove containers if systemd services are stopped.
2021-03-27 23:03:56 +00:00

21 lines
1.1 KiB
Desktop File

[Unit]
Description=Dovecot POP3/IMAP server
Wants=container-build@%N.service container-network@mail.service container-network@internal.service mariadb.service rspamd.service
After=container-build@%N.service container-network@mail.service container-network@internal.service mariadb.service rspamd.service
[Service]
Restart=always
ExecStartPre=/bin/install --owner 5000 --group 5000 -d /var/lib/container-service/mail
ExecStart=/bin/podman run --replace --pull never --net internal,mail,mariadb --env-file /etc/container-service/%N/%N.env \
--env-file /etc/container-service/rspamd/rspamd.env \
--publish 143:143 --publish 993:993 \
--volume /var/lib/container-service/mail:/var/mail:z \
--volume /etc/container-service/%N/service/config:/etc/%N/conf.d:z \
--volume /var/lib/container-service/letsencrypt/private:/etc/ssl/private:z \
--name %N localhost/%N:latest
ExecStop=/bin/podman stop --time 10 %N
ExecStopPost=/bin/podman rm --force %N
[Install]
WantedBy=multi-user.target