Last active
February 19, 2017 01:54
-
-
Save hunner/6134154 to your computer and use it in GitHub Desktop.
Vagrantfile example with vagrant-hosts and vagrant-auto_network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure('2') do |config| | |
# Specify box files | |
config.vm.box = 'precise32' | |
config.vm.box_url = 'http://files.vagrantup.com/precise32.box' | |
# Create web frontend | |
config.vm.define 'web.example.com' do |node| | |
node.vm.network :forwarded_port, guest: 443, host: 4443 | |
node.vm.network :forwarded_port, guest: 80, host: 8080 | |
# Automatically configure networking and /etc/hosts | |
node.vm.extend AutoNetwork::Mixin | |
node.vm.auto_network! | |
node.vm.provision :hosts | |
end | |
# Create api backend on the same network | |
config.vm.define 'api.example.com' do |node| | |
# Automatically configure networking and /etc/hosts | |
node.vm.extend AutoNetwork::Mixin | |
node.vm.auto_network! | |
node.vm.provision :hosts | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment