Run with node, install config outside sources

This commit is contained in:
Salamandar 2024-07-09 23:14:31 +02:00
parent 7194467d42
commit 80f35a3e3b
3 changed files with 8 additions and 8 deletions

View file

@ -6,10 +6,10 @@ After=network.target
Type=simple Type=simple
Environment=NODE_ENV=production Environment=NODE_ENV=production
Environment="__YNH_NODE_LOAD_PATH__" Environment="__YNH_NODE_LOAD_PATH__"
Environment=NODE_CONFIG_DIR=__INSTALL_DIR__/sources/config Environment=NODE_CONFIG_DIR=__INSTALL_DIR__/config
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
ExecStart=__YNH_NPM__ start ExecStart=__YNH_NODE__ __INSTALL_DIR__/sources/dist/server.js
WorkingDirectory=__INSTALL_DIR__/sources/ WorkingDirectory=__INSTALL_DIR__/sources/
StandardOutput=syslog StandardOutput=syslog
StandardError=syslog StandardError=syslog

View file

@ -53,10 +53,10 @@ popd
#================================================= #=================================================
ynh_script_progression --message="Adding a config file..." ynh_script_progression --message="Adding a config file..."
ynh_add_config --template="default.yaml" --destination="$install_dir/sources/config/production.yaml" ynh_add_config --template="default.yaml" --destination="$install_dir/config/production.yaml"
chmod 400 "$install_dir/sources/config/production.yaml" chmod 400 "$install_dir/config/production.yaml"
chown "$app:$app" "$install_dir/sources/config/production.yaml" chown "$app:$app" "$install_dir/config/production.yaml"
#================================================= #=================================================
# SYSTEM CONFIGURATION # SYSTEM CONFIGURATION

View file

@ -74,10 +74,10 @@ popd
#================================================= #=================================================
ynh_script_progression --message="Updating a config file..." ynh_script_progression --message="Updating a config file..."
ynh_add_config --template="default.yaml" --destination="$install_dir/sources/config/production.yaml" ynh_add_config --template="default.yaml" --destination="$install_dir/config/production.yaml"
chmod 400 "$install_dir/sources/config/production.yaml" chmod 400 "$install_dir/config/production.yaml"
chown "$app:$app" "$install_dir/sources/config/production.yaml" chown "$app:$app" "$install_dir/config/production.yaml"
#================================================= #=================================================
# REAPPLY SYSTEM CONFIGURATIONS # REAPPLY SYSTEM CONFIGURATIONS