-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
71 lines (60 loc) · 2.5 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
# Based on defaults for SilverStripe Ltd projects.
# See https://silverstripe.atlassian.net/wiki/spaces/DEV/pages/401506576.
Vagrant.configure(2) do |config|
# Webroot defaults.
# Don't change this to public/, it will be auto-detected in the box
WEBROOT_HOST = "."
WEBROOT_GUEST = "/var/www/mysite/www"
# Change this IP to avoid clashes with other running virtual machines
# on your own host machine virtual network
config.vm.network "private_network", ip: "192.168.33.4"
# Change to a unique host name.
# Sets automatically when using the vagrant-hostsupdater plugin.
# Use a *.vagrant top level domain to get built-in SSL certificates
config.vm.hostname = "myproject.vagrant"
# Handy for subsites
#config.hostsupdater.aliases = ["mysubsite1.vagrant", "mysubsite2.vagrant"]
# Choose an SSP or CWP base box
config.vm.box = "silverstripeltd/dev-ssp"
# config.vm.box = "silverstripeltd/dev-cwp"
# Update memory settings for Virtualbox
# See https://www.vagrantup.com/docs/virtualbox/configuration.html#vboxmanage-customizations
# Needs additional config for other providers, see https://www.vagrantup.com/docs/providers/
config.vm.provider "virtualbox" do |v, override|
v.memory = 2048
v.cpus = 2
end
# Configure webroot and mount options
# See https://github.com/gael-ian/vagrant-bindfs
if Vagrant.has_plugin?("vagrant-bindfs") then
# Useful for OSX (for optimal performance)
config.vm.synced_folder WEBROOT_HOST, "/vagrant-nfs", type: "nfs"
config.bindfs.bind_folder "/vagrant-nfs", WEBROOT_GUEST,
force_user: 'vagrant',
force_group: 'vagrant',
perms: 'u=rwX:g=rD:o=rD',
o: 'nonempty'
else
# For Windows and Linux
config.vm.synced_folder WEBROOT_HOST, WEBROOT_GUEST, type: "nfs"
end
# Reduce disk space by cloning from master VM
# See https://www.vagrantup.com/docs/virtualbox/configuration.html#linked-clones
config.vm.provider 'virtualbox' do |v|
v.linked_clone = true
end
# Optional apt and composer cache (shared beween boxes)
# See https://github.com/fgrehm/vagrant-cachier
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
config.cache.enable :apt
config.cache.enable :composer
config.cache.enable :npm
end
# Forward SSH agent, important for private git checkouts
config.ssh.forward_agent = true
# Set default directory to webroot
config.vm.provision "shell",
inline: "echo 'cd #{WEBROOT_GUEST}' >> /home/vagrant/.bashrc",
name: "default dir"
end