Created
November 7, 2013 15:53
-
-
Save yandod/7356902 to your computer and use it in GitHub Desktop.
Single file Vagrntfile which spin up Ubuntu 12.04 + PHP5.5 + Nginx + MySQL
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 : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "precise64" | |
config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
src_dir = './' | |
doc_root = '/vagrant_data/webroot' | |
app_name = File.basename(File.dirname(__FILE__)) | |
config.vm.network :forwarded_port, guest: 80, host: 8080 | |
config.vm.synced_folder src_dir, "/vagrant_data", :create => true, :owner=> 'vagrant', :group=>'www-data', :mount_options => ['dmode=775,fmode=775'] | |
config.berkshelf.enabled = true | |
File.open('Berksfile', 'w').write <<-EOS | |
cookbook 'apt' | |
cookbook 'php5_ppa', git: "https://github.com/yandod/php5_ppa.git", branch: "ondrej" | |
cookbook 'omusubi', git: "https://github.com/yandod/omusubi.git" | |
EOS | |
config.vm.provision :chef_solo do |chef| | |
chef.add_recipe "apt" | |
chef.add_recipe "php5_ppa::from_ondrej" | |
chef.add_recipe "omusubi" | |
versions = {}; | |
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.vm.provision :shell, :inline => <<-EOS | |
mysql -u root --execute "create database if not exists #{app_name}" | |
cd /vagrant_data; composer update | |
#cd /vagrant_data/app; yes | ./Console/cake schema update | |
EOS | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment