Document concrete /srv/task-inventory deployment scenario
This commit is contained in:
24
README.md
24
README.md
@@ -75,11 +75,27 @@ POST /api/render-markdown body: { text, mode? } → { html }
|
|||||||
|
|
||||||
## Running as a system service
|
## Running as a system service
|
||||||
|
|
||||||
`deployment/task-inventory.service` is a systemd unit file. To use it:
|
`deployment/task-inventory.service` targets `/srv/task-inventory` with a dedicated `task-inventory` user.
|
||||||
|
|
||||||
1. Fill in `WorkingDirectory` with the path to the deployed app
|
```bash
|
||||||
2. Create a dedicated user: `useradd -r task-inventory`
|
# Create service user
|
||||||
3. `sudo systemctl enable --now "$(realpath deployment/task-inventory.service)"`
|
sudo useradd -r task-inventory
|
||||||
|
|
||||||
|
# Deploy files
|
||||||
|
sudo cp -r . /srv/task-inventory
|
||||||
|
sudo chown -R task-inventory:task-inventory /srv/task-inventory
|
||||||
|
|
||||||
|
# Install dependencies as service user
|
||||||
|
sudo -u task-inventory npm ci --prefix /srv/task-inventory
|
||||||
|
|
||||||
|
# Copy and configure config.yaml
|
||||||
|
sudo cp config.yaml.example /srv/task-inventory/config.yaml
|
||||||
|
sudo chown task-inventory:task-inventory /srv/task-inventory/config.yaml
|
||||||
|
# edit /srv/task-inventory/config.yaml
|
||||||
|
|
||||||
|
# Enable and start
|
||||||
|
sudo systemctl enable --now "$(realpath deployment/task-inventory.service)"
|
||||||
|
```
|
||||||
|
|
||||||
Packaging (Arch, Debian, etc.) is not set up yet.
|
Packaging (Arch, Debian, etc.) is not set up yet.
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ User=task-inventory
|
|||||||
Group=task-inventory
|
Group=task-inventory
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=node server.mjs
|
ExecStart=node server.mjs
|
||||||
WorkingDirectory= MUST BE FILLED IN
|
WorkingDirectory=/srv/task-inventory
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|||||||
Reference in New Issue
Block a user