Skip to content

Instantly share code, notes, and snippets.

@bergantine
Last active December 17, 2015 00:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bergantine/5521525 to your computer and use it in GitHub Desktop.
Save bergantine/5521525 to your computer and use it in GitHub Desktop.
Vagrantfile for Flask-Newproj #vagrant #flask #python #vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.define :djangovm do |cfg|
# Every Vagrant virtual environment requires a box to build off of.
# The precise64_vagrant122 box is built for vagrant 1.2.2
cfg.vm.box = "precise64_vagrant122"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
cfg.vm.box_url = "http://files.vagrantup.com/precise64.box"
# Forward a port from the guest to the host, which allows for outside
# computers to access the VM, whereas host only networking does not.
cfg.vm.forward_port 80, 8080
# To access our website, we can open a web browser on our workstation
# and go to http://localhost:5001.
cfg.vm.forward_port 5000, 5001
# Enable provisioning with chef solo, specifying a cookbooks path
# (relative to this Vagrantfile), and adding some recipes and/or
# roles.
#
cfg.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
# compilers
chef.add_recipe "apt"
chef.add_recipe "build-essential"
# openssl is a requirement for postgresql
chef.add_recipe "openssl"
# git
chef.add_recipe "git"
# python, python-dev plus pip and virtualenv
chef.add_recipe "python"
chef.add_recipe "python::pip"
chef.add_recipe "python::virtualenv"
# tie it all together
chef.add_recipe "chef-cookbook-flaskproj"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment