Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Vagrant config
# vi: set ft=ruby :
current_dir = File.basename(Dir.getwd)
$script = <<-SCRIPT
#!/usr/bin/env bash
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
apt-get update
apt-get -y upgrade
apt-get -y dist-upgrade
apt-get install -y nodejs
apt-get install -y tree
apt-get install -y htop
apt-get install -y mc
apt-get install -y zsh
chsh -s $(which zsh)
cd /home/vagrant/#{current_dir} && npm install --no-bin-link
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.hostname = "dev"
config.vm.network :forwarded_port, guest: 80, host: 3000
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provider "virtualbox" do |vb|
vb.name = current_dir
vb.memory = "4096"
end
config.vm.synced_folder ".", "/home/vagrant/#{current_dir}"
config.vm.provision :shell, inline: $script
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment