-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction-planner-api.service.example
More file actions
34 lines (31 loc) · 1.24 KB
/
Copy pathfunction-planner-api.service.example
File metadata and controls
34 lines (31 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Example systemd unit for the Function Planner API.
# The client is static files served by nginx — no client unit is needed.
#
# Install:
# 1. Adjust User, Group, WorkingDirectory, and EnvironmentFile for your host
# (paths below assume a checkout at /opt/function-planner after `npm run build`).
# tsc emits under dist/src/, so ExecStart is dist/src/index.js.
# 2. sudo cp deploy/systemd/function-planner-api.service.example \
# /etc/systemd/system/function-planner-api.service
# 3. sudo systemctl daemon-reload
# 4. sudo systemctl enable --now function-planner-api
#
# apps/server/src/loadEnv.ts also loads apps/server/.env; EnvironmentFile= still
# sets NODE_ENV and any vars before Node starts. ExecStart calls node directly
# (equivalent to `npm run start -w apps/server`) so the unit does not depend on npm.
[Unit]
Description=Function Planner API
After=network.target postgresql.service
Wants=postgresql.service
[Service]
Type=simple
User=function-planner
Group=function-planner
WorkingDirectory=/opt/function-planner/apps/server
Environment=NODE_ENV=production
EnvironmentFile=/opt/function-planner/apps/server/.env
ExecStart=/usr/bin/node dist/src/index.js
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target