]> git.openstreetmap.org Git - rails.git/blob - Vagrantfile
Merge pull request #5932 from tomhughes/frozen-strings
[rails.git] / Vagrantfile
1 # frozen_string_literal: true
2
3 # -*- mode: ruby -*-
4 # vi: set ft=ruby :
5
6 Vagrant.configure("2") do |config|
7   # use official debian image
8   config.vm.box = "debian/bookworm64"
9
10   # configure virtualbox provider
11   config.vm.provider "virtualbox" do |vb, override|
12     override.vm.synced_folder ".", "/srv/openstreetmap-website"
13     vb.customize ["modifyvm", :id, "--memory", "4096"]
14     vb.customize ["modifyvm", :id, "--cpus", "2"]
15     vb.customize ["modifyvm", :id, "--uartmode1", "disconnected"]
16   end
17
18   # Use sshfs sharing if available, otherwise NFS sharing
19   sharing_type = Vagrant.has_plugin?("vagrant-sshfs") ? "sshfs" : "nfs"
20
21   # configure lxc provider
22   config.vm.provider "lxc" do |_, override|
23     override.vm.synced_folder ".", "/srv/openstreetmap-website", :type => sharing_type
24   end
25
26   # configure libvirt provider
27   config.vm.provider "libvirt" do |libvirt, override|
28     override.vm.synced_folder ".", "/srv/openstreetmap-website", :type => sharing_type
29     libvirt.memory = 4096
30     libvirt.cpus = 2
31   end
32
33   # configure shared package cache if possible
34   if Vagrant.has_plugin?("vagrant-cachier")
35     config.cache.enable :apt
36     config.cache.scope = :box
37   end
38
39   # port forward for webrick on 3000
40   config.vm.network :forwarded_port, :guest => 3000, :host => 3000
41
42   # provision using a simple shell script
43   config.vm.provision :shell, :path => "script/vagrant/setup/provision.sh"
44 end