-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
81 lines (61 loc) · 2.94 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
72
73
74
75
76
77
78
79
80
81
$script = <<-SCRIPT
# echo "Preparing local node_modules folder…"
# mkdir -p /home/vagrant/app/sdk/vagrant_node_modules
# chown vagrant:vagrant /home/vagrant/app/sdk/vagrant_node_modules
echo "cd /vagrant" >> /home/vagrant/.profile
echo "cd /vagrant" >> /home/vagrant/.bashrc
echo "All good!!"
SCRIPT
Vagrant.configure("2") do |config|
######## March 23, 2020 - Support for express setup
# Please read the instructions under network/setup/vexpress/README.md
# March 24, 2020 - changed to 18.04
# 1. Use this for "Standard setup"
config.vm.box = "bento/ubuntu-18.04"
# 2. Use this for "VirtualBox Express Setup"
# config.vm.box = "acloudfan/hlfdev2.0-0"
# Uncomment the lines below if you would like to protect the VM
# config.ssh.username = 'vagrant'
# config.ssh.password = 'vagrant'
# config.ssh.insert_key = 'true'
# Ports foward
# For Orderer Container
# config.vm.network "forwarded_port", guest: 7050, host: 7050
# #Explorer
# config.vm.network "forwarded_port", guest: 8080, host: 8080
# #CouchDB
# config.vm.network "forwarded_port", guest: 5984, host: 5984
# # For Peer Container
# config.vm.network "forwarded_port", guest: 7051, host: 7051
# config.vm.network "forwarded_port", guest: 7052, host: 7052
# config.vm.network "forwarded_port", guest: 8051, host: 8051
# config.vm.network "forwarded_port", guest: 8052, host: 8052
# config.vm.network "forwarded_port", guest: 9051, host: 9051
# config.vm.network "forwarded_port", guest: 9052, host: 9052
# This gets executed for both vm1 & vm2
# config.vm.provision "shell", inline: "echo 'All good'"
config.vm.provision "shell", inline: $script
# config.vm.provision "shell", run: "always", inline: <<-SHELL
# mount --bind /home/vagrant/app/sdk/node_modules /home/vagrant/app/sdk/vagrant_node_modules
# SHELL
# To use a diffrent Hypervisor create a section config.vm.provider
# And comment out the following section
# Configuration for Virtual Box
config.vm.provider :virtualbox do |vb|
# Change the memory here if needed - 3 Gb memory on Virtual Box VM
vb.customize ["modifyvm", :id, "--memory", "3072", "--cpus", "1"]
# Change this only if you need destop for Ubuntu - you will need more memory
vb.gui = false
# In case you have DNS issues
# vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
# Configuration for Windows Hyperv
config.vm.provider :hyperv do |hv|
# Change the memory here if needed - 2 Gb memory on Virtual Box VM
hv.customize ["modifyvm", :id, "--memory", "3072", "--cpus", "1"]
# Change this only if you need destop for Ubuntu - you will need more memory
hv.gui = false
# In case you have DNS issues
# vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
end