coreos-home-server/config/service/nginx/systemd/nginx-ingress.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
911 B
Desktop File

[Unit]
Description=Nginx ingress controller
Wants=container-build@nginx.service container-network@%N.service
After=container-build@nginx.service container-network@%N.service
[Service]
Restart=always
ExecStartPre=/bin/install --owner 10000 --group 10000 -d /var/lib/container-service/letsencrypt/private
ExecStartPre=/bin/install -d /var/lib/container-service/%N/conf.d
ExecStart=/bin/podman run --replace --pull never --net %N \
--publish 80:80 --publish 443:443 \
--volume /var/lib/container-service/letsencrypt/private:/etc/ssl/private:z \
--volume /var/lib/container-service/%N/conf.d:/etc/nginx/conf.d:z \
--name %N localhost/nginx:latest
ExecStop=/bin/podman stop --time 10 %N
ExecStopPost=/bin/podman rm --force %N
ExecReload=/bin/podman exec %N nginx -s reload
[Install]
WantedBy=multi-user.target