Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 1 | Vagrant.configure("2") do |config| |
Scott Baker | 665839d | 2016-06-29 07:36:36 -0700 | [diff] [blame] | 2 | # base image |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 3 | config.vm.box = "ubuntu/trusty64" |
| 4 | |
Scott Baker | 665839d | 2016-06-29 07:36:36 -0700 | [diff] [blame] | 5 | # share the folder |
Matteo Scandolo | 76d7bcd | 2016-11-30 17:08:17 -0800 | [diff] [blame] | 6 | config.vm.synced_folder "../../", "/home/vagrant/", create: true |
Matteo Scandolo | c217d70 | 2016-06-29 16:58:33 -0700 | [diff] [blame] | 7 | config.vm.synced_folder ".", "/vagrant", disabled: true |
Scott Baker | 665839d | 2016-06-29 07:36:36 -0700 | [diff] [blame] | 8 | |
Matteo Scandolo | d23b7bd | 2016-11-18 15:52:45 -0800 | [diff] [blame] | 9 | # set the frontend vm |
| 10 | config.vm.define "frontend" do |d| |
| 11 | d.vm.network "forwarded_port", guest: 9999, host: 9999 |
| 12 | d.vm.network "forwarded_port", guest: 6379, host: 6379 |
| 13 | d.vm.network "private_network", ip: "192.168.46.100" |
| 14 | d.vm.provider "virtualbox" do |vb| |
| 15 | vb.memory = "2048" |
| 16 | end |
Scott Baker | 665839d | 2016-06-29 07:36:36 -0700 | [diff] [blame] | 17 | end |
| 18 | |
Matteo Scandolo | d23b7bd | 2016-11-18 15:52:45 -0800 | [diff] [blame] | 19 | config.vm.provision "shell", privileged: false, inline: <<-SHELL |
| 20 | sudo apt-get update |
| 21 | sudo apt-get install -y apt-transport-https ca-certificates git |
| 22 | sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D |
| 23 | echo deb https://apt.dockerproject.org/repo ubuntu-trusty main | sudo tee /etc/apt/sources.list.d/docker.list |
| 24 | sudo apt-get update |
| 25 | sudo apt-get install -y git docker-engine python-pip |
| 26 | sudo pip install docker-compose |
| 27 | sudo groupadd docker |
| 28 | sudo usermod -aG docker vagrant |
| 29 | SHELL |
| 30 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 31 | end |