diff --git a/deploy/aitools.service b/deploy/aitools.service index 6a7a8db..d62cb1e 100644 --- a/deploy/aitools.service +++ b/deploy/aitools.service @@ -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