Create a gist now

Instantly share code, notes, and snippets.

@fgrehm /Vagrantfile Secret
Created Oct 13, 2013

Ventriloquist + Discourse
# -*- mode: ruby -*-
# vi: set ft=ruby :
# See https://github.com/discourse/discourse/blob/master/docs/VAGRANT.md
#
Vagrant.configure("2") do |config|
config.vm.box = 'raring64'
# Comment out if you don't have plans to use vagrant-cachier
config.cache.auto_detect = true
# Make this VM reachable on the host network as well, so that other
# VM's running other browsers can access our dev server.
config.vm.network :private_network, ip: "192.168.10.200"
# Make it so that network access from the vagrant guest is able to
# use SSH private keys that are present on the host without copying
# them into the VM.
config.ssh.forward_agent = true
config.vm.provider :virtualbox do |v, override|
# This setting gives the VM 1024MB of RAM instead of the default 384.
v.customize ["modifyvm", :id, "--memory", [ENV['DISCOURSE_VM_MEM'].to_i, 1024].max]
# This setting makes it so that network access from inside the vagrant guest
# is able to resolve DNS using the hosts VPN connection.
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
override.vm.box_url = 'http://goo.gl/Y4aRr'
end
config.vm.provider :lxc do |lxc, override|
lxc.customize 'aa_profile', 'unconfined'
override.vm.box_url = 'http://bit.ly/vagrant-lxc-raring64-2013-09-28-'
end
# Required to boot nested containers
config.vm.provision :shell, inline: %[
if ! [ -f /etc/default/lxc ]; then
cat <<STR > /etc/default/lxc
LXC_AUTO="false"
USE_LXC_BRIDGE="false"
STR
fi
]
config.vm.network :forwarded_port, guest: 3000, host: 4000
config.vm.network :forwarded_port, guest: 1080, host: 4080 # Mailcatcher
nfs_setting = RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", :nfs => nfs_setting
config.vm.provision :ventriloquist do |env|
env.services << %w( mailcatcher redis pg:9.1 )
env.platforms << %w( nodejs ruby )
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment