Last active
July 14, 2016 15:00
-
-
Save jsoriano/8904632 to your computer and use it in GitHub Desktop.
Small example with vagrant, docker and Digital Ocean
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Quick start: | |
# - vagrant plugin install vagrant-digitalocean | |
# - Set-up ~/.digital_ocean.rb like this: | |
# module DigitalOceanKeys | |
# CLIENT_ID = 'foooooooo' | |
# API_KEY = 'fabada' | |
# end | |
# - vagrant up --provider=digital_ocean | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.define "docker-test01" do |test01| | |
test01.vm.hostname = "docker-test01" | |
test01.vm.box = "wheezy64" | |
test01.vm.box_url = "https://dl.dropboxusercontent.com/u/197673519/debian-7.2.0.box" | |
test01.vm.provision "docker" do |docker| | |
docker.run "redis01", | |
image: "dockerfile/redis" | |
docker.run "mongodb01", | |
image: "dockerfile/mongodb" | |
docker.run "rabbitmq01", | |
image: "tutum/rabbitmq" | |
end | |
end | |
config.vm.provider :digital_ocean do |provider, override| | |
require '~/.digital_ocean.rb' | |
include DigitalOceanKeys | |
override.ssh.username = 'vagrant' | |
override.ssh.private_key_path = '~/.ssh/id_rsa' | |
override.vm.box = 'digital_ocean' | |
override.vm.box_url = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box" | |
provider.image = 'Debian 7.0 x64' | |
provider.region = 'Amsterdam 1' | |
provider.client_id = CLIENT_ID | |
provider.api_key = API_KEY | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment