If you are like me, I hate having a lot of extra stuff on my laptop such as
mysql, apache/nginx, etc. All those extra services are such a pain in the ass to
maintain and other developers may have different versions of the same things.
This can lead to issues during development and has the potential to cause issues
with your application when in production that cannot be reproduced.
It is assumed that you have the following installed and working.
You can commit all of this into your repository. If you plan to expand on this
and use more cookbooks or upload them to a chef server, you will need to do some
more work. This will just get you started in the right direction.
The app cookbook is only used locally to help provision you vagrant
Next we will need to modify the cookbook we created so it provisions the vagrant
Add Required Cookbooks
You will need to append these cookbooks to the metadata.rb file.
NOTE: You can swap out the postgresql cookbook with mysql, the reason I use
postgresql is because I deploy symfony 2 apps to heroku.
The attributes file allows you modify things a little easier when deploying the
project to production or if you need to change a few settings.
Modify Your default Recipe
Creating Your Berksfile
Creating Your Vagrantfile
You should now be able to run vagrant up and then visit http://localhost:8080
in your browser. This should allow all developers on your team to work within
the exact same stack and will allow you to easily modify configuration settings
to how you want.
This guide should be basic enough to get you up and running. You may need to
modify some of the files to your liking or to configure some extras.