-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
147 lines (147 loc) · 4.77 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
Vagrant::Config.run do |config|
config.vm.box = "geerlingguy/ubuntu1604"
config.vm.forward_port 80, 8000
config.vm.provision "chef_solo" do |chef|
chef.cookbooks_path = ["site-cookbooks", "cookbooks"]
chef.json = {
"run_list": [
"recipe[apt]",
"recipe[sudo]",
"recipe[build-essential]",
"recipe[ohai]",
"recipe[runit]",
"recipe[git]",
"recipe[postgresql]",
"recipe[postgresql::contrib]",
"recipe[postgresql::server]",
"recipe[nginx]",
"recipe[nginx::apps]",
"recipe[redis::install_from_package]",
"recipe[redis::client]",
"recipe[monit]",
"recipe[monit::ssh]",
"recipe[monit::nginx]",
"recipe[monit::postgresql]",
"recipe[monit::redis-server]",
"recipe[rvm::user]",
"recipe[chef-rails]"
],
"automatic": {
"ipaddress": "127.0.0.1"
},
"authorization": {
"sudo": {
"groups": ["ubuntu"],
"users": ["vagrant"],
"passwordless": true
}
},
"postgresql": {
"contrib": {
"extensions": ["pg_stat_statements"]
},
"config": {
"shared_buffers": "125MB",
"shared_preload_libraries": "pg_stat_statements"
},
"password": {
"postgres": "psql_passwd"
}
},
"nginx": {
"users": ["vagrant"],
"distribution": "xenial",
"components": ["main"],
"worker_rlimit_nofile": 30000,
"apps": {
"example.com": {
"listen": [80],
"server_name": "example.com www.example.com",
"public_path": "/home/deploy/production.example.com/current/public",
"upstreams": [
{
"name": "example.com",
"servers": [
"unix:/home/deploy/production.example.com/shared/pids/example.com.sock max_fails=3 fail_timeout=1s"
]
}
],
"locations": [
{
"path": "/",
"directives": [
"proxy_set_header X-Forwarded-Proto $scheme;",
"proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;",
"proxy_set_header X-Real-IP $remote_addr;",
"proxy_set_header Host $host;",
"proxy_redirect off;",
"proxy_http_version 1.1;",
"proxy_set_header Connection '';",
"proxy_pass http://example.com;"
]
},
{
"path": "~ ^/(assets|fonts|system)/|favicon.ico|robots.txt",
"directives": [
"gzip_static on;",
"expires max;",
"add_header Cache-Control public;"
]
}
]
},
"example2.com": {
"listen": [80],
"server_name": "example2.com www.example2.com",
"public_path": "/home/deploy/production.example2.com/current/public",
"upstreams": [
{
"name": "example2.com",
"servers": [
"0.0.0.0:3000 max_fails=3 fail_timeout=1s",
"0.0.0.0:3001 max_fails=3 fail_timeout=1s"
]
}
],
"locations": [
{
"path": "/",
"directives": [
"proxy_set_header X-Forwarded-Proto $scheme;",
"proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;",
"proxy_set_header X-Real-IP $remote_addr;",
"proxy_set_header Host $host;",
"proxy_redirect off;",
"proxy_http_version 1.1;",
"proxy_set_header Connection '';",
"proxy_pass http://example2.com;"
]
},
{
"path": "~ ^/(assets|fonts|system)/|favicon.ico|robots.txt",
"directives": [
"gzip_static on;",
"expires max;",
"add_header Cache-Control public;"
]
}
]
}
}
},
"rvm": {
"user_installs": [{
"user": "vagrant",
"default_ruby": "2.3.3"
}]
},
"monit": {
"poll_period": "30",
"poll_start_delay": "60"
},
"chef-rails": {
"packages": ["imagemagick", "nodejs-dev"]
}
}
end
end