Skip to content

Instantly share code, notes, and snippets.

@LukeChannings
Created October 3, 2014 16:05
Show Gist options
  • Save LukeChannings/2ded291f5adc3cc6a800 to your computer and use it in GitHub Desktop.
Save LukeChannings/2ded291f5adc3cc6a800 to your computer and use it in GitHub Desktop.
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "web", primary: true do |web|
web.vm.hostname = "dev-env"
web.vm.box = "trusty32"
web.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-i386-vagrant-disk1.box"
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
config.vm.provider "virtualbox" do |v|
v.memory = 512
v.cpus = 2
end
if ENV['NODE_ENV'] != "production"
web.vm.network :forwarded_port, guest: 5000, host: 8083 # Server
web.vm.network :forwarded_port, guest: 5001, host: 8082 # Client
web.vm.network :forwarded_port, guest: 5002, host: 8084 # Proxy
end
config.vm.synced_folder ".", "/app", type: "rsync",
rsync__exclude: [".git", "node_modules", "js-prod", "css", "html"]
web.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 1
end
web.vm.provision :shell do |s|
s.path = "scripts/bootstrap.sh"
s.args = "#{ENV['NODE_ENV'] || 'development'} #{ENV['GRUNT_MANUALLY'] || '0'}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment