Skip to content

Instantly share code, notes, and snippets.

@adamw
Last active August 29, 2015 14:02
Show Gist options
  • Save adamw/bf6fa803b6b13fd7430b to your computer and use it in GitHub Desktop.
Save adamw/bf6fa803b6b13fd7430b to your computer and use it in GitHub Desktop.
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# http://www.vagrantbox.es/
config.vm.box = "ubuntu-12.04-docker"
config.vm.box_url = "https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/ubuntu-12.04-amd64-vbox.box"
# Sets the ip we'll use to access the box
config.vm.network :private_network, ip: "10.0.0.10"
config.vm.hostname = "myapp"
# Configures the amount of RAM
config.vm.provider "virtualbox" do |box|
box.customize ["modifyvm", :id, "--memory", "1024"]
end
# We need to have the docker apt repository available
config.vm.provision :shell, path: "setup_docker_apt.sh"
# Specifies the chef version Opsworks is running
config.omnibus.chef_version = "11.10.0"
# Chef related configs
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "../../myapp-chef"
chef.log_level = :info
# Config as in opsworks
chef.json = {
"sender" => {
"image" => "adamw/myapp:latest",
"cmdline" => [ "com.softwaremill.myapp.Main", "10" ],
"env" => {
"AWS_ACCESS_KEY_ID" => ENV['AWS_ACCESS_KEY_ID'],
"AWS_SECRET_ACCESS_KEY" => ENV['AWS_SECRET_ACCESS_KEY']
}
}
}
# Chef, use these recipes
chef.add_recipe "docker::setup"
chef.add_recipe "docker::kill_containers"
chef.add_recipe "docker::myapp"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment