-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
77 lines (58 loc) · 2.48 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
$script = <<-SCRIPT
echo "cd /vagrant" >> /home/vagrant/.profile
echo "The Virtual Machine is up"
cd /vagrant/scripts
chmod 755 fabric-setup.sh
chmod 755 caserver-setup.sh
sudo ./fabric-setup.sh
sudo ./caserver-setup.sh
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.boot_timeout = 600
config.ssh.username = 'vagrant'
config.ssh.password = 'vagrant'
config.ssh.insert_key = 'true'
# Ports foward
# For REST Server
config.vm.network "forwarded_port", guest: 3000, host: 3000
# For Docker Deamon
config.vm.network "forwarded_port", guest: 2375, host: 2375
# For Orderer
config.vm.network "forwarded_port", guest: 7050, host: 7050
# For Peer Containers of hospital-org
config.vm.network "forwarded_port", guest: 7051, host: 7051
config.vm.network "forwarded_port", guest: 7052, host: 7052
config.vm.network "forwarded_port", guest: 7053, host: 7053
# For Peer Containers of lab-org
config.vm.network "forwarded_port", guest: 8051, host: 8051
config.vm.network "forwarded_port", guest: 8052, host: 8052
config.vm.network "forwarded_port", guest: 8053, host: 8053
# For CA Container
config.vm.network "forwarded_port", guest: 7054, host: 7054
config.vm.provision "docker"
#config.vm.provision "shell", inline: "echo 'All good'"
config.vm.provision "shell", inline: $script
# 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|
vb.name = "blockchain-assignment"
# Change the memory here if needed - 2 Gb memory on Virtual Box VM
vb.customize ["modifyvm", :id, "--memory", "2048", "--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|
hv.name = "blockchain-assignment"
# Change the memory here if needed - 2 Gb memory on Virtual Box VM
hv.customize ["modifyvm", :id, "--memory", "2048", "--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