vagrant up

This commit is contained in:
2019-12-10 16:50:32 -05:00
parent 729b6ecaba
commit 42700d8d0a
9 changed files with 124 additions and 32 deletions

View File

@ -78,20 +78,19 @@ end
if node['nodejs']['service']
systemd_unit "node-#{node['app']['name']}.service" do
content <<~EOU
[Unit]
Description=NodeJS app for #{node['app']['name']}
After=network.target
[Unit]
Description=NodeJS app for #{node['app']['name']}
After=redis-server.target
[Service]
Environment=NODE_PORT=#{node['nodejs']['port']}
Environment=NODE_PATH=#{node['nodejs']['env_path']}/node_modules/
Type=simple
WorkingDirectory=#{node['nodejs']['working-dir']}
ExecStart=/usr/bin/env node #{node['nodejs']['working-dir']}/#{node['nodejs']['exec_file']}
Restart=on-failure
[Service]
Environment=NODE_PORT=#{node['nodejs']['port']}
Environment=NODE_PATH=#{node['nodejs']['env_path']}/node_modules/
Type=simple
WorkingDirectory=#{node['nodejs']['working-dir']}
ExecStart=/usr/bin/env node #{node['nodejs']['working-dir']}/#{node['nodejs']['exec_file']}
Restart=on-failure
[Install]
WantedBy=multi-user.target
[Install]
EOU
action [:create, :enable, :start]
end

View File

@ -55,8 +55,14 @@ directory '/var/log/nginx/' do
action :create
end
template '/etc/openresty/sites-enabled/host.conf' do
source 'openresty/simple-proxy.conf.erb'
if node['web']['t42-proxy']
template '/etc/openresty/sites-enabled/proxy.conf' do
source 'openresty/010-proxy.conf.erb'
end
else
template '/etc/openresty/sites-enabled/host.conf' do
source 'openresty/simple-proxy.conf.erb'
end
end
systemd_unit 'openresty' do