Skip to content

Commit

Permalink
Vagrantfile: Add updated nodejs repos (from upstream), fix shared fol…
Browse files Browse the repository at this point in the history
…der to work on macs
  • Loading branch information
sneakers-the-rat committed Jan 18, 2024
1 parent 5bcd2d1 commit eb354f3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
sudo apt-add-repository 'deb https://dl.yarnpkg.com/debian/ stable main'
# Add repo for NodeJS
curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=20
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
# Add firewall rule to redirect 80 to PORT and save
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port #{ENV["PORT"]}
Expand Down Expand Up @@ -162,7 +166,12 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
end

if config.vm.networks.any? { |type, options| type == :private_network }
config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ['rw', 'actimeo=1']
if (/darwin/ =~ RUBY_PLATFORM) != nil
# typical synced folder doesn't work on Macs :(
config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ['rw', 'vers=3', 'tcp', 'actimeo=1']
else
config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ['rw', 'actimeo=1']
end
else
config.vm.synced_folder ".", "/vagrant"
end
Expand Down

0 comments on commit eb354f3

Please sign in to comment.