Small nodejs quality of life improvements

This commit is contained in:
Antoine Lima 2024-03-10 22:56:08 +01:00
parent 23546d9cd2
commit a28c27e3c4
No known key found for this signature in database
GPG key ID: 5D1E65E3DEB73410
3 changed files with 8 additions and 1 deletions

View file

@ -7,6 +7,7 @@ StartLimitBurst=5
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl restart __APP__-nodejs.service
Restart=on-failure
[Install]
WantedBy=multi-user.target

View file

@ -11,6 +11,7 @@ StandardOutput=append:/var/log/__APP__-nodejs.log
StandardError=inherit
Environment=__YNH_NODE_LOAD_PATH__
Environment=PORT=__PORT__
Environment=NODE_ENV=production
ExecStartPre=__YNH_NPM__ install
ExecStartPre=__YNH_NPM__ run build
ExecStart=__YNH_NPM__ run start

View file

@ -99,13 +99,18 @@ fi
#=================================================
# RELOAD NGINX AND PHP-FPM
#=================================================
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..."
ynh_script_progression --message="Reloading NGINX and the server..."
if [ $phpversion != "none" ]
then
ynh_systemd_action --service_name=php${phpversion}-fpm --action=reload
fi
if [ $nodeversion != "none" ]
then
ynh_systemd_action --service_name=$app-nodejs --action=reload
fi
ynh_systemd_action --service_name=nginx --action=reload
#=================================================