# -*- mode: ruby -*-
# vi: set ft=ruby :

require 'fileutils'

#$fes = 1
#$rslavess = 1 

Vagrant.configure("2") do |config|

    config.vm.define "rmaster" do |rm|     
        rm.vm.provider "docker" do |d|
            d.vagrant_vagrantfile = "./dev/hosts/Vagrantfile"  
            d.build_dir = "redis-master"
            d.name = "rmaster"
            d.create_args = ["--privileged=true", "-m", "1g"]
            #d.ports = [ "6379:6379" ]
            d.remains_running = true
        end
    end

    config.vm.define "frontend" do |fe|
        fe.vm.provider "docker" do |d|
            d.vagrant_vagrantfile = "./dev/hosts/Vagrantfile"
            d.build_dir = "web-server"
            d.name = "web-server"
            d.create_args = ["--privileged=true"]
            d.remains_running = true
            d.create_args = d.create_args << "--link" << "rmaster:rmaster"
            d.ports = ["3000:3000"]
            d.env = {"REDISMASTER_SERVICE_HOST"=>"rmaster","REDISMASTER_SERVICE_PORT"=>"6379"} 
        end
    end
 
    ### Todo , add data generator.

end
