]> git.mxchange.org Git - friendica.git/blob - Vagrantfile
adjusted configuration due to problems with mailcatcher
[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         = "400" # MB
22 server_swap           = "800" # 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 Packages
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   # Use NFS for the shared folder
81   config.vm.synced_folder ".", "/vagrant",
82             id: "core",
83             :nfs => true,
84             :mount_options => ['nolock,vers=3,udp,noatime']
85
86   # If using VirtualBox
87   config.vm.provider :virtualbox do |vb|
88
89     # Set server memory
90     vb.customize ["modifyvm", :id, "--memory", server_memory]
91
92     # Set the timesync threshold to 10 seconds, instead of the default 20 minutes.
93     # If the clock gets more than 15 minutes out of sync (due to your laptop going
94     # to sleep for instance, then some 3rd party services will reject requests.
95     vb.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 10000]
96
97     # Prevent VMs running on Ubuntu to lose internet connection
98     # vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
99     # vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
100
101   end
102
103   # If using VMWare Fusion
104   config.vm.provider "vmware_fusion" do |vb, override|
105     override.vm.box_url = "http://files.vagrantup.com/precise64_vmware.box"
106
107     # Set server memory
108     vb.vmx["memsize"] = server_memory
109
110   end
111
112   # If using Vagrant-Cachier
113   # http://fgrehm.viewdocs.io/vagrant-cachier
114   if Vagrant.has_plugin?("vagrant-cachier")
115     # Configure cached packages to be shared between instances of the same base box.
116     # Usage docs: http://fgrehm.viewdocs.io/vagrant-cachier/usage
117     config.cache.scope = :box
118
119     config.cache.synced_folder_opts = {
120         type: :nfs,
121         mount_options: ['rw', 'vers=3', 'tcp', 'nolock']
122     }
123   end
124
125   ####
126   # Base Items
127   ##########
128
129   # Provision Base Packages
130   config.vm.provision "shell", path: "#{github_url}/scripts/base.sh", args: [github_url, server_swap]
131
132   # Provision PHP
133   config.vm.provision "shell", path: "#{github_url}/scripts/php.sh", args: [server_timezone, hhvm]
134
135   # Enable MSSQL for PHP
136   # config.vm.provision "shell", path: "#{github_url}/scripts/mssql.sh"
137
138   # Provision Vim
139   # config.vm.provision "shell", path: "#{github_url}/scripts/vim.sh", args: github_url
140
141
142   ####
143   # Web Servers
144   ##########
145
146   # Provision Apache Base
147   config.vm.provision "shell", path: "#{github_url}/scripts/apache.sh", args: [server_ip, public_folder, hostname, github_url]
148
149   # Provision Nginx Base
150   # config.vm.provision "shell", path: "#{github_url}/scripts/nginx.sh", args: [server_ip, public_folder, hostname, github_url]
151
152
153   ####
154   # Databases
155   ##########
156
157   # Provision MySQL
158   config.vm.provision "shell", path: "#{github_url}/scripts/mysql.sh", args: [mysql_root_password, mysql_version, mysql_enable_remote]
159
160   # Provision PostgreSQL
161   # config.vm.provision "shell", path: "#{github_url}/scripts/pgsql.sh", args: pgsql_root_password
162
163   # Provision SQLite
164   # config.vm.provision "shell", path: "#{github_url}/scripts/sqlite.sh"
165
166   # Provision RethinkDB
167   # config.vm.provision "shell", path: "#{github_url}/scripts/rethinkdb.sh", args: pgsql_root_password
168
169   # Provision Couchbase
170   # config.vm.provision "shell", path: "#{github_url}/scripts/couchbase.sh"
171
172   # Provision CouchDB
173   # config.vm.provision "shell", path: "#{github_url}/scripts/couchdb.sh"
174
175   # Provision MongoDB
176   # config.vm.provision "shell", path: "#{github_url}/scripts/mongodb.sh"
177
178   # Provision MariaDB
179   # config.vm.provision "shell", path: "#{github_url}/scripts/mariadb.sh", args: [mysql_root_password, mysql_enable_remote]
180
181   ####
182   # Search Servers
183   ##########
184
185   # Install Elasticsearch
186   # config.vm.provision "shell", path: "#{github_url}/scripts/elasticsearch.sh"
187
188   # Install SphinxSearch
189   # config.vm.provision "shell", path: "#{github_url}/scripts/sphinxsearch.sh"
190
191   ####
192   # Search Server Administration (web-based)
193   ##########
194
195   # Install ElasticHQ
196   # Admin for: Elasticsearch
197   # Works on: Apache2, Nginx
198   # config.vm.provision "shell", path: "#{github_url}/scripts/elastichq.sh"
199
200
201   ####
202   # In-Memory Stores
203   ##########
204
205   # Install Memcached
206   # config.vm.provision "shell", path: "#{github_url}/scripts/memcached.sh"
207
208   # Provision Redis (without journaling and persistence)
209   # config.vm.provision "shell", path: "#{github_url}/scripts/redis.sh"
210
211   # Provision Redis (with journaling and persistence)
212   # config.vm.provision "shell", path: "#{github_url}/scripts/redis.sh", args: "persistent"
213   # NOTE: It is safe to run this to add persistence even if originally provisioned without persistence
214
215
216   ####
217   # Utility (queue)
218   ##########
219
220   # Install Beanstalkd
221   # config.vm.provision "shell", path: "#{github_url}/scripts/beanstalkd.sh"
222
223   # Install Heroku Toolbelt
224   # config.vm.provision "shell", path: "https://toolbelt.heroku.com/install-ubuntu.sh"
225
226   # Install Supervisord
227   # config.vm.provision "shell", path: "#{github_url}/scripts/supervisord.sh"
228
229   ####
230   # Additional Languages
231   ##########
232
233   # Install Nodejs
234   # config.vm.provision "shell", path: "#{github_url}/scripts/nodejs.sh", privileged: false, args: nodejs_packages.unshift(nodejs_version, github_url)
235
236   # Install Ruby Version Manager (RVM)
237   # config.vm.provision "shell", path: "#{github_url}/scripts/rvm.sh", privileged: false, args: ruby_gems.unshift(ruby_version)
238
239   ####
240   # Frameworks and Tooling
241   ##########
242
243   # Provision Composer
244   # config.vm.provision "shell", path: "#{github_url}/scripts/composer.sh", privileged: false, args: composer_packages.join(" ")
245
246   # Provision Laravel
247   # config.vm.provision "shell", path: "#{github_url}/scripts/laravel.sh", privileged: false, args: [server_ip, laravel_root_folder, public_folder, laravel_version]
248
249   # Provision Symfony
250   # config.vm.provision "shell", path: "#{github_url}/scripts/symfony.sh", privileged: false, args: [server_ip, symfony_root_folder, public_folder]
251
252   # Install Screen
253   # config.vm.provision "shell", path: "#{github_url}/scripts/screen.sh"
254
255   # Install config Mailcatcher
256   # ls -config.vm.provision "shell", path: "#{github_url}/scripts/mailcatcher.sh"
257
258   # Install git-ftp
259   # config.vm.provision "shell", path: "#{github_url}/scripts/git-ftp.sh", privileged: false
260
261   ####
262   # Local Scripts
263   # Any local scripts you may want to run post-provisioning.
264   # Add these to the same directory as the Vagrantfile.
265   ##########
266   config.vm.provision "shell", path: "./util/vagrant_provision.sh"
267   config.vm.synced_folder "./", "/vagrant/", :owner=> 'www-data', :group=>'vagrant', :mount_options => ['dmode=775', 'fmode=775']
268
269 end