vagrant up
This commit is contained in:
		| @ -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 | ||||
|  | ||||
| @ -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 | ||||
|  | ||||
		Reference in New Issue
	
	Block a user