Created
February 29, 2016 15:46
-
-
Save pkfrom/515bc4a14994d2ade989 to your computer and use it in GitHub Desktop.
Vagrantfile DO
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| | |
config.ssh.private_key_path = 'sshkey/id_rsa' | |
config.vm.box ='ubuntu/trusty64' | |
config.vm.network "forwarded_port", guest: 80, host: 8080 | |
provider_is_do = (!ARGV.nil? && ARGV.join('').include?('provider=digital_ocean')) | |
config.vm.provision 'shell', inline: <<-SHELL | |
sudo apt-get update | |
sudo apt-get install -y nginx | |
SHELL | |
config.vm.define 'web' do |web| | |
web.vm.provider :virtualbox do |vbox| | |
vbox.customize ['modifyvm', :id, '--memory', 1024] | |
end | |
if provider_is_do | |
web.vm.provider :digital_ocean do |docean, override| | |
config.vm.box = 'digital_ocean' | |
config.vm.box_url = 'https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box' | |
docean.token = ENV['DO_TOKEN'] | |
docean.image = 'ubuntu-14-04-x64' | |
docean.region = 'sgp1' | |
docean.size = '1gb' | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment