refactor: turn systemd unit into a template
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SfihHazrSHXgndJtSNLubJ
This commit is contained in:
parent
991afb9c71
commit
b051cd8c4e
1 changed files with 7 additions and 4 deletions
|
|
@ -1,13 +1,16 @@
|
|||
# Template : install.sh remplace @APP_DIR@, @DATA_DIR@ et @APP_USER@.
|
||||
[Unit]
|
||||
Description=AiTools (panel prospection IA)
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
# Ne démarre pas si le disque de données n'est pas monté
|
||||
RequiresMountsFor=@DATA_DIR@
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=aitools
|
||||
WorkingDirectory=/opt/aitools
|
||||
ExecStart=/usr/bin/node --env-file=/opt/aitools/.env --no-warnings=ExperimentalWarning src/server.js
|
||||
User=@APP_USER@
|
||||
WorkingDirectory=@APP_DIR@
|
||||
ExecStart=/usr/bin/node --env-file=@APP_DIR@/.env --no-warnings=ExperimentalWarning src/server.js
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
Environment=NODE_ENV=production
|
||||
|
|
@ -19,7 +22,7 @@ NoNewPrivileges=true
|
|||
PrivateTmp=true
|
||||
ProtectSystem=strict
|
||||
ProtectHome=read-only
|
||||
ReadWritePaths=/opt/aitools/data -/home/aitools/.claude -/home/aitools/.claude.json
|
||||
ReadWritePaths=@DATA_DIR@ /home/@APP_USER@
|
||||
ProtectKernelTunables=true
|
||||
ProtectControlGroups=true
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue