Skip to content

Instantly share code, notes, and snippets.

@sayanriju
Last active December 18, 2020 12:42
Show Gist options
  • Save sayanriju/7942f962ea030c0a782cff38656c0c53 to your computer and use it in GitHub Desktop.
Save sayanriju/7942f962ea030c0a782cff38656c0c53 to your computer and use it in GitHub Desktop.
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<-SCRIPT
rsync -a --delete --delete-excluded --exclude 'node_modules' /vagrant/ /home/vagrant/project
cd /home/vagrant/project
npm install --unsafe-perm
pm2 kill && pm2 start bin/www
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "sayanriju/anmr"
config.vm.network "forwarded_port", guest: 3000, host: 8080, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 27017, host: 27019, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 6379, host: 6381, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 1025, host: 1025, host_ip: "127.0.0.1" ## maildev smtp server
config.vm.network "forwarded_port", guest: 1080, host: 1080, host_ip: "127.0.0.1" ## maildev web ui
config.vm.provision :shell, inline: $script, run: 'always'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment