From 1344099d1496026d6e1bd46492efa3c7c9c791cc Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 15 Mar 2023 15:31:13 +0100 Subject: [PATCH] feat(docs): add service files --- config/pronouns-api.service | 19 +++++++++++++++++++ config/pronouns-clean.service | 19 +++++++++++++++++++ config/pronouns-clean.timer | 9 +++++++++ config/pronouns-exporter.service | 19 +++++++++++++++++++ config/pronouns-fe.service | 19 +++++++++++++++++++ pronounscc.nginx => config/pronounscc.nginx | 0 6 files changed, 85 insertions(+) create mode 100644 config/pronouns-api.service create mode 100644 config/pronouns-clean.service create mode 100644 config/pronouns-clean.timer create mode 100644 config/pronouns-exporter.service create mode 100644 config/pronouns-fe.service rename pronounscc.nginx => config/pronounscc.nginx (100%) diff --git a/config/pronouns-api.service b/config/pronouns-api.service new file mode 100644 index 0000000..3f90b0b --- /dev/null +++ b/config/pronouns-api.service @@ -0,0 +1,19 @@ +[Unit] +Description=pronouns.cc API +After=syslog.target +After=network.target +Requires=postgresql.service redis.service + +[Service] +RestartSec=2s +Type=simple +User=pronouns +Group=pronouns +AmbientCapabilities= +WorkingDirectory=/home/pronouns/src +ExecStart=/home/pronouns/src/pronouns web +Restart=always +Environment=USER=pronouns HOME=/home/pronouns + +[Install] +WantedBy=multi-user.target diff --git a/config/pronouns-clean.service b/config/pronouns-clean.service new file mode 100644 index 0000000..f254ed6 --- /dev/null +++ b/config/pronouns-clean.service @@ -0,0 +1,19 @@ +[Unit] +Description=Clean pronouns.cc database +After=syslog.target +After=network.target +Requires=postgresql.service redis.service + +[Service] +RestartSec=2s +Type=oneshot +User=pronouns +Group=pronouns +AmbientCapabilities= +WorkingDirectory=/home/pronouns/src +ExecStart=/home/pronouns/src/pronouns database clean +Restart=no +Environment=USER=pronouns HOME=/home/pronouns + +[Install] +WantedBy=multi-user.target diff --git a/config/pronouns-clean.timer b/config/pronouns-clean.timer new file mode 100644 index 0000000..d53de1c --- /dev/null +++ b/config/pronouns-clean.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Clean pronouns.cc database daily + +[Timer] +OnCalendar=daily +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/config/pronouns-exporter.service b/config/pronouns-exporter.service new file mode 100644 index 0000000..4e53821 --- /dev/null +++ b/config/pronouns-exporter.service @@ -0,0 +1,19 @@ +[Unit] +Description=pronouns.cc data exporter service +After=syslog.target +After=network.target +Requires=postgresql.service redis.service + +[Service] +RestartSec=2s +Type=simple +User=pronouns +Group=pronouns +AmbientCapabilities= +WorkingDirectory=/home/pronouns/src +ExecStart=/home/pronouns/src/pronouns exporter +Restart=always +Environment=USER=pronouns HOME=/home/pronouns + +[Install] +WantedBy=multi-user.target diff --git a/config/pronouns-fe.service b/config/pronouns-fe.service new file mode 100644 index 0000000..84b6d63 --- /dev/null +++ b/config/pronouns-fe.service @@ -0,0 +1,19 @@ +[Unit] +Description=pronouns.cc frontend +After=syslog.target +After=network.target +Requires=pronouns-api.service + +[Service] +RestartSec=2s +Type=simple +User=pronouns +Group=pronouns +AmbientCapabilities= +WorkingDirectory=/home/pronouns/src/frontend +ExecStart=node build/index.js +Restart=always +Environment=USER=pronouns HOME=/home/pronouns + +[Install] +WantedBy=multi-user.target diff --git a/pronounscc.nginx b/config/pronounscc.nginx similarity index 100% rename from pronounscc.nginx rename to config/pronounscc.nginx