Skip to content

Instantly share code, notes, and snippets.

@AaronGhent
Created January 14, 2016 00:32
Show Gist options
  • Save AaronGhent/729cbd3936ecdac8d5ed to your computer and use it in GitHub Desktop.
Save AaronGhent/729cbd3936ecdac8d5ed to your computer and use it in GitHub Desktop.
Virtual Machine for NodeJS
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.hostname = "nodejs"
config.vm.network :forwarded_port, guest: 3000, host: 3000
config.vm.synced_folder "./", "/home/vagrant/srv", create: true, group: "vagrant", owner: "vagrant"
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
config.vm.provision "shell", inline: <<-SHELL
echo ":: >><<>><<>><<>><<>><<>><<>><<>><<>><<>><< ::"
echo "Installing System (Patience Please)"
echo ":: >><<>><<>><<>><<>><<>><<>><<>><<>><<>><< ::"
sudo apt-get -qq update
sudo apt-get -qq -y install build-essential nodejs npm nodejs-legacy
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment