-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathVagrantfile-sample
58 lines (44 loc) · 2.56 KB
/
Vagrantfile-sample
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# This Vagrantfile is intended to be used with universal-vagrant
# https://github.com/anwarishak/universal-vagrant/releases
#
# Copy this file into your project root, modify the parameters below as indicated in the comments
# and run > vagrant up. The provisioning scripts may take several minutes to complete, depending
# on the speed of your computer.
VAGRANTFILE_API_VERSION = "2"
# [CHECK THIS!] Path to universal-vagrant relative to project root, including a trailing slash.
PATH_TO_UNIVERSAL_VAGRANT = "../universal-vagrant/"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
# config.vm.box_url = "http://files.vagrantup.com/trusty64.box"
config.vm.network :forwarded_port, guest: 80, host: 8080, auto_correct: true
config.vm.network :forwarded_port, guest: 3000, host: 8081, auto_correct: true
config.vm.synced_folder PATH_TO_UNIVERSAL_VAGRANT, "/universal-vagrant"
# [CHECK THIS!] Uncomment and modify the following lines if you want to map certain folders
# within the Vagrant box to a folder within your project. Your project root is seen as
# /vagrant from within the Vagrant box. You can also set the folder permissions.
#config.vm.synced_folder "./some-cache", "/vagrant/some-cache", :mount_options => ["dmode=777","fmode=666"]
#config.vm.synced_folder "./cms-assets", "/vagrant/cms-assets", :mount_options => ["dmode=777","fmode=666"]
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
end
config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
config.vm.provision :shell, :path => PATH_TO_UNIVERSAL_VAGRANT + "scripts/bootstrap.sh"
config.vm.provision :shell, :path => PATH_TO_UNIVERSAL_VAGRANT + "scripts/apache.sh"
config.vm.provision :shell, :path => PATH_TO_UNIVERSAL_VAGRANT + "scripts/mysql.sh"
config.vm.provision :shell, :path => PATH_TO_UNIVERSAL_VAGRANT + "scripts/php.sh"
config.vm.provision :shell, :path => PATH_TO_UNIVERSAL_VAGRANT + "scripts/nodejs.sh"
# [CHECK THIS!] You can add extra provisioning shell commands here. E.g. to set a particular
# folder as the webroot, or install a particular PHP extension.
$script = "
echo \"Doing some last minute provisioning\"
rm /var/www/default/public_html
ln -fs /vagrant/webroot /var/www/default/public_html
service apache2 restart
"
# [CHECK THIS!] Uncomment the next line to enable the extra bits of provisioning/configuration
# above.
#config.vm.provision "shell", inline: $script
end