Created
January 20, 2014 23:52
-
-
Save benharold/8531734 to your computer and use it in GitHub Desktop.
Precise64 based Vagrantfile for Nginx, MySQL, PHP 5.5.
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
# precise64 based | |
config.vm.box = "precise64" | |
config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
# location of the source directory for the project | |
src_dir = './src' | |
# location of the document_root of the webserver | |
doc_root = './src/public' | |
# name of the project | |
app_name = 'project' | |
config.vm.network :forwarded_port, guest: 80, host: 8080 | |
config.vm.synced_folder src_dir, "/web", :create => true, :owner => 'vagrant', :group => 'www-data', :mount_options => ['dmode=775,fmode=775'] | |
# plugins | |
config.berkshelf.enabled = true | |
config.omnibus.chef_version = :latest | |
File.open('Berksfile', 'w').write <<-EOS | |
cookbook 'apt' | |
cookbook 'php5_ppa', git: "https://github.com/benharold/php5_ppa.git" | |
cookbook 'omusubi', git: "https://github.com/benharold/omusubi.git" | |
cookbook 'user', git: "https://github.com/fnichol/chef-user.git" | |
EOS | |
# Chef solo provisioning | |
config.vm.provision :chef_solo do |chef| | |
chef.add_recipe "apt" | |
chef.add_recipe "php5_ppa::from_ondrej" | |
chef.add_recipe "omusubi" | |
# http://fnichol.github.io/chef-user/ | |
# chef.add_recipe "user" | |
versions = {}; | |
# if you would use php5.3 family with fast boot, comment out lines bellow. | |
versions['php5'] = '5.5.*' | |
versions['php5-mysql'] = '5.5.*' | |
versions['php5-pgsql'] = '5.5.*' | |
versions['php5-curl'] = '5.5.*' | |
versions['php5-mcrypt'] = '5.5.*' | |
versions['php5-cli'] = '5.5.*' | |
versions['php5-fpm'] = '5.5.*' | |
versions['php-pear'] = '5.5.*' | |
versions['php5-imagick'] = '3.*' | |
chef.json = {doc_root: doc_root, 'versions' => versions} | |
end | |
# config.ssh.private_key_path = "~/.ssh/id_rsa" | |
# config.vm.provider :digital_ocean do |provider| | |
# provider.client_id = "CLIENT ID" | |
# provider.api_key = "API KEY" | |
# provider.image = "Ubuntu 12.03.3 x64" | |
# provider.region = "New York 2" | |
# end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment