-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathVagrantfile
51 lines (38 loc) · 1.56 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
# Enable the vagrant env plugin
config.env.enable
config.vm.hostname = ENV["HOSTNAME_IN_GUEST"]
config.vm.box = ENV["CONFIG_VM_BOX"]
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
config.vm.box_check_update = true
config.vm.network "forwarded_port", guest: 80, host: ENV["FORWARDED_PORT_80"]
config.vm.network "forwarded_port", guest: 443, host: ENV["FORWARDED_PORT_443"]
# Create a private network, which allows host-only access to the machine using a specific IP.
config.vm.network "private_network", ip: ENV["VM_IP"]
# Set the hostname using the vagrant hostupdater plugin
config.hostsupdater.remove_on_suspend = false
config.hostsupdater.aliases = [ENV["HOSTNAME_IN_HOST"]]
config.vm.synced_folder ".", "/vagrant", type: "virtualbox",
owner: "vagrant",
group: "www-data",
mount_options: ["dmode=775,fmode=774"]
config.vm.provider "virtualbox" do |vb|
# vb.memory = "1024"
# Get virtual box name vagrant env plugin
vb.name = ENV["HOSTNAME_IN_GUEST"]
end
# Run our customizations
config.vm.provision "shell" do |s|
s.path = "bootstrap.sh"
end
# Restart apache when all done (if using apache)
config.vm.provision "shell", run: "always", inline: "service apache2 restart"
# Help the developer to find the app :)
config.trigger.after [:up] do
system("open #{ENV['URL_OF_DEPLOYED_APP']}")
end
end