]> git.mxchange.org Git - friendica.git/blob - Vagrantfile
Merge remote-tracking branch 'friendica/master' into mail_notification_cleanup
[friendica.git] / Vagrantfile
1 # -*- mode: ruby -*-
2 # vi: set ft=ruby :
3
4 # Config Github Settings
5 github_username = "fideloper"
6 github_repo     = "Vaprobash"
7 github_branch   = "1.0.0"
8 github_url      = "https://raw.githubusercontent.com/#{github_username}/#{github_repo}/#{github_branch}"
9
10 # Server Configuration
11
12 hostname        = "vaprobash.dev"
13
14 # Set a local private network IP address.
15 # See http://en.wikipedia.org/wiki/Private_network for explanation
16 # You can use the following IP ranges:
17 #   10.0.0.1    - 10.255.255.254
18 #   172.16.0.1  - 172.31.255.254
19 #   192.168.0.1 - 192.168.255.254
20 server_ip             = "192.168.22.10"
21 server_memory         = "384" # MB
22 server_swap           = "768" # Options: false | int (MB) - Guideline: Between one or two times the server_memory
23 server_timezone       = "UTC"
24
25 # Database Configuration
26 mysql_root_password   = "root"   # We'll assume user "root"
27 mysql_version         = "5.5"    # Options: 5.5 | 5.6
28 mysql_enable_remote   = "false"  # remote access enabled when true
29 pgsql_root_password   = "root"   # We'll assume user "root"
30
31 # Languages and Packages6
32 ruby_version          = "latest" # Choose what ruby version should be installed (will also be the default version)
33 ruby_gems             = [        # List any Ruby Gems that you want to install
34   #"jekyll",
35   #"sass",
36   #"compass",
37 ]
38
39 # To install HHVM instead of PHP, set this to "true"
40 hhvm                  = "false"
41
42 # PHP Options
43 composer_packages     = [        # List any global Composer packages that you want to install
44   #"phpunit/phpunit:4.0.*",
45   #"codeception/codeception=*",
46   #"phpspec/phpspec:2.0.*@dev",
47   #"squizlabs/php_codesniffer:1.5.*",
48 ]
49
50 # Default web server document root
51 # Symfony's public directory is assumed "web"
52 # Laravel's public directory is assumed "public"
53 public_folder         = "/vagrant"
54
55 laravel_root_folder   = "/vagrant/laravel" # Where to install Laravel. Will `composer install` if a composer.json file exists
56 laravel_version       = "latest-stable" # If you need a specific version of Laravel, set it here
57 symfony_root_folder   = "/vagrant/symfony" # Where to install Symfony.
58
59 nodejs_version        = "latest"   # By default "latest" will equal the latest stable version
60 nodejs_packages       = [          # List any global NodeJS packages that you want to install
61   #"grunt-cli",
62   #"gulp",
63   #"bower",
64   #"yo",
65 ]
66
67 Vagrant.configure("2") do |config|
68
69   # Set server to Ubuntu 14.04
70   config.vm.box = "ubuntu/trusty64"
71
72   # Create a hostname, don't forget to put it to the `hosts` file
73   # This will point to the server's default virtual host
74   # TO DO: Make this work with virtualhost along-side xip.io URL
75   config.vm.hostname = hostname
76
77   # Create a static IP
78   config.vm.network :private_network, ip: server_ip
79
80   # If using VirtualBox
81   config.vm.provider :virtualbox do |vb|
82
83     # Set server memory
84     vb.customize ["modifyvm", :id, "--memory", server_memory]
85
86     # Set the timesync threshold to 10 seconds, instead of the default 20 minutes.
87     # If the clock gets more than 15 minutes out of sync (due to your laptop going
88     # to sleep for instance, then some 3rd party services will reject requests.
89     vb.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 10000]
90
91     # Prevent VMs running on Ubuntu to lose internet connection
92     vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
93     vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
94
95   end
96
97   # If using VMWare Fusion
98   config.vm.provider "vmware_fusion" do |vb, override|
99     override.vm.box_url = "http://files.vagrantup.com/precise64_vmware.box"
100
101     # Set server memory
102     vb.vmx["memsize"] = server_memory
103
104   end
105
106   # If using Vagrant-Cachier
107   # http://fgrehm.viewdocs.io/vagrant-cachier
108   if Vagrant.has_plugin?("vagrant-cachier")
109     # Configure cached packages to be shared between instances of the same base box.
110     # Usage docs: http://fgrehm.viewdocs.io/vagrant-cachier/usage
111     config.cache.scope = :box
112
113     config.cache.synced_folder_opts = {
114         type: :nfs,
115         mount_options: ['rw', 'vers=3', 'tcp', 'nolock']
116     }
117   end
118
119   ####
120   # Base Items
121   ##########
122
123   # Provision Base Packages
124   config.vm.provision "shell", path: "#{github_url}/scripts/base.sh", args: [github_url, server_swap]
125
126   # Provision PHP
127   config.vm.provision "shell", path: "#{github_url}/scripts/php.sh", args: [server_timezone, hhvm]
128
129   # Enable MSSQL for PHP
130   # config.vm.provision "shell", path: "#{github_url}/scripts/mssql.sh"
131
132   # Provision Vim
133   # config.vm.provision "shell", path: "#{github_url}/scripts/vim.sh", args: github_url
134
135
136   ####
137   # Web Servers
138   ##########
139
140   # Provision Apache Base
141   config.vm.provision "shell", path: "#{github_url}/scripts/apache.sh", args: [server_ip, public_folder, hostname, github_url]
142
143   # Provision Nginx Base
144   # config.vm.provision "shell", path: "#{github_url}/scripts/nginx.sh", args: [server_ip, public_folder, hostname, github_url]
145
146
147   ####
148   # Databases
149   ##########
150
151   # Provision MySQL
152   config.vm.provision "shell", path: "#{github_url}/scripts/mysql.sh", args: [mysql_root_password, mysql_version, mysql_enable_remote]
153
154   # Provision PostgreSQL
155   # config.vm.provision "shell", path: "#{github_url}/scripts/pgsql.sh", args: pgsql_root_password
156
157   # Provision SQLite
158   # config.vm.provision "shell", path: "#{github_url}/scripts/sqlite.sh"
159
160   # Provision RethinkDB
161   # config.vm.provision "shell", path: "#{github_url}/scripts/rethinkdb.sh", args: pgsql_root_password
162
163   # Provision Couchbase
164   # config.vm.provision "shell", path: "#{github_url}/scripts/couchbase.sh"
165
166   # Provision CouchDB
167   # config.vm.provision "shell", path: "#{github_url}/scripts/couchdb.sh"
168
169   # Provision MongoDB
170   # config.vm.provision "shell", path: "#{github_url}/scripts/mongodb.sh"
171
172   # Provision MariaDB
173   # config.vm.provision "shell", path: "#{github_url}/scripts/mariadb.sh", args: [mysql_root_password, mysql_enable_remote]
174
175   ####
176   # Search Servers
177   ##########
178
179   # Install Elasticsearch
180   # config.vm.provision "shell", path: "#{github_url}/scripts/elasticsearch.sh"
181
182   # Install SphinxSearch
183   # config.vm.provision "shell", path: "#{github_url}/scripts/sphinxsearch.sh"
184
185   ####
186   # Search Server Administration (web-based)
187   ##########
188
189   # Install ElasticHQ
190   # Admin for: Elasticsearch
191   # Works on: Apache2, Nginx
192   # config.vm.provision "shell", path: "#{github_url}/scripts/elastichq.sh"
193
194
195   ####
196   # In-Memory Stores
197   ##########
198
199   # Install Memcached
200   # config.vm.provision "shell", path: "#{github_url}/scripts/memcached.sh"
201
202   # Provision Redis (without journaling and persistence)
203   # config.vm.provision "shell", path: "#{github_url}/scripts/redis.sh"
204
205   # Provision Redis (with journaling and persistence)
206   # config.vm.provision "shell", path: "#{github_url}/scripts/redis.sh", args: "persistent"
207   # NOTE: It is safe to run this to add persistence even if originally provisioned without persistence
208
209
210   ####
211   # Utility (queue)
212   ##########
213
214   # Install Beanstalkd
215   # config.vm.provision "shell", path: "#{github_url}/scripts/beanstalkd.sh"
216
217   # Install Heroku Toolbelt
218   # config.vm.provision "shell", path: "https://toolbelt.heroku.com/install-ubuntu.sh"
219
220   # Install Supervisord
221   # config.vm.provision "shell", path: "#{github_url}/scripts/supervisord.sh"
222
223   ####
224   # Additional Languages
225   ##########
226
227   # Install Nodejs
228   # config.vm.provision "shell", path: "#{github_url}/scripts/nodejs.sh", privileged: false, args: nodejs_packages.unshift(nodejs_version, github_url)
229
230   # Install Ruby Version Manager (RVM)
231   # config.vm.provision "shell", path: "#{github_url}/scripts/rvm.sh", privileged: false, args: ruby_gems.unshift(ruby_version)
232
233   ####
234   # Frameworks and Tooling
235   ##########
236
237   # Provision Composer
238   # config.vm.provision "shell", path: "#{github_url}/scripts/composer.sh", privileged: false, args: composer_packages.join(" ")
239
240   # Provision Laravel
241   # config.vm.provision "shell", path: "#{github_url}/scripts/laravel.sh", privileged: false, args: [server_ip, laravel_root_folder, public_folder, laravel_version]
242
243   # Provision Symfony
244   # config.vm.provision "shell", path: "#{github_url}/scripts/symfony.sh", privileged: false, args: [server_ip, symfony_root_folder, public_folder]
245
246   # Install Screen
247   # config.vm.provision "shell", path: "#{github_url}/scripts/screen.sh"
248
249   # Install config Mailcatcher
250   # config.vm.provision "shell", path: "#{github_url}/scripts/mailcatcher.sh"
251
252   # Install git-ftp
253   # config.vm.provision "shell", path: "#{github_url}/scripts/git-ftp.sh", privileged: false
254
255   ####
256   # Local Scripts
257   # Any local scripts you may want to run post-provisioning.
258   # Add these to the same directory as the Vagrantfile.
259   ##########
260   config.vm.provision "shell", path: "./util/vagrant_provision.sh"
261   config.vm.synced_folder "./", "/vagrant/", :owner=> 'www-data', :group=>'vagrant', :mount_options => ['dmode=775', 'fmode=775']
262
263 end