Skip to content

Instantly share code, notes, and snippets.

@siraskalot
Created August 16, 2018 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save siraskalot/aefe990982177c76ff2415120075f031 to your computer and use it in GitHub Desktop.
Save siraskalot/aefe990982177c76ff2415120075f031 to your computer and use it in GitHub Desktop.
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