diff --git a/ppf.container.service b/ppf.container.service new file mode 100644 index 0000000..a6df6cf --- /dev/null +++ b/ppf.container.service @@ -0,0 +1,36 @@ +[Unit] +Description=PPF Proxy Validator Container +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +Restart=on-failure +RestartSec=30 +TimeoutStartSec=90 +TimeoutStopSec=30 + +# Container runtime +ExecStartPre=-/usr/bin/podman stop -t 10 ppf +ExecStartPre=-/usr/bin/podman rm -f ppf +ExecStart=/usr/bin/podman run \ + --name ppf \ + --rm \ + --log-driver=journald \ + --network=slirp4netns:allow_host_loopback=true \ + -v %h/ppf/config.ini:/app/config.ini:ro,Z \ + -v %h/ppf/servers.txt:/app/servers.txt:ro,Z \ + -v %h/ppf/data:/app/data:Z \ + -e PYTHONUNBUFFERED=1 \ + localhost/ppf:latest \ + python proxywatchd.py + +ExecStop=/usr/bin/podman stop -t 10 ppf + +# Logging +StandardOutput=journal +StandardError=journal +SyslogIdentifier=ppf + +[Install] +WantedBy=default.target