-
Notifications
You must be signed in to change notification settings - Fork 2
/
Vagrantfile
85 lines (78 loc) · 2.41 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# encoding: utf-8
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.ssh.forward_agent = true
config.vm.forward_port 80, 8888
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = ["cookbooks"]
chef.add_recipe :apt
chef.add_recipe 'git'
chef.add_recipe 'postgresql::client'
chef.add_recipe 'postgresql::server'
chef.add_recipe 'python'
chef.add_recipe 'nginx'
chef.add_recipe 'supervisor'
chef.add_recipe 'onionornot'
chef.json = {
:git => {
:prefix => "/usr/local"
},
:postgresql => {
:config => {
:listen_addresses => "*",
:port => "5432"
},
:pg_hba => [
{
:type => "local",
:db => "postgres",
:user => "postgres",
:addr => nil,
:method => "trust"
},
{
:type => "host",
:db => "all",
:user => "all",
:addr => "0.0.0.0/0",
:method => "md5"
},
{
:type => "host",
:db => "all",
:user => "all",
:addr => "::1/0",
:method => "md5"
}
],
:password => {
:postgres => "password"
}
},
:nginx => {
:dir => "/etc/nginx",
:log_dir => "/var/log/nginx",
:binary => "/usr/sbin/nginx",
:user => "www-data",
:init_style => "runit",
:pid => "/var/run/nginx.pid",
:worker_connections => "1024"
},
:supervisor => {
:service_name => "Gunicorn",
:command => "/vagrant/gunicorn.sh",
:user => "vagrant",
:directory => "/vagrant/",
:stdout_logfile => "/var/log/supervisor/onionornot.log",
:sterr_logfile => "/var/log/supervisor/onionornot-error.log",
:autostart => true,
:autorestart => true
}
}
end
config.vm.provision :shell, :inline => "sudo cp /vagrant/configs/nginx/sites-enabled/default /etc/nginx/sites-enabled/default"
config.vm.provision :shell, :inline => "sudo /etc/init.d/nginx reload"
end