diff --git a/conf/nodejs-watcher.service b/conf/nodejs-watcher.service index 1f2d480..7492d53 100644 --- a/conf/nodejs-watcher.service +++ b/conf/nodejs-watcher.service @@ -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 diff --git a/conf/nodejs.service b/conf/nodejs.service index 2af7859..20a6b08 100644 --- a/conf/nodejs.service +++ b/conf/nodejs.service @@ -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 diff --git a/scripts/restore b/scripts/restore index 401e36e..4e79a5f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -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 #=================================================