Code Monkey home page Code Monkey logo

vagrantfiles's Introduction

Vagrantfiles

Just a cheeky repository with some base Vagrantfiles I use in a number of projects. Each setup is based on a vanilla installation of Ubuntu 14.04 LTS (Trusty Tahr) from Vagrant Cloud.

How do I use it?

To download a vagrant box for your project, just run the following. Remember to replace $LANG with an available language from the list below.

curl -O https://raw.githubusercontent.com/adlawson/vagrantfiles/master/$LANG/Vagrantfile
vagrant up
vagrant ssh
cd /srv

Available languages

Language Tooling Version Extras
brainfuck bf 20041219ubuntu5
clojure Leiningen stable Java 8
csharp Mono stable
elixir Mix latest from erlang-solutions.com
erlang Rebar latest from erlang-solutions.com
golang Godep 1.4.2 from golang.org
haskell 2010
hhvm Composer latest from ppa:mapnik/boost
iojs NPM 1.2.0 from iojs.org
julia latest from ppa:staticfloat/juliareleases
lua 5.2.*
nodejs NPM latest from ppa:chris-lea/node.js
ocaml latest from ppa:asvm/ppa OPAM
perl 5.*
php Composer 5.6.* from ppa:ondrej/php5-5.6 Xdebug
python Pip 3.4.* and 2.7.* (python3 and python)
racket 5.93
ruby Gem 2.2.0 RVM
rust Cargo stable
scala SBT 2.11.5 Java 8
scheme latest mit-scheme

Template

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

    hostname = "<your language name here>.box"
    locale = "en_GB.UTF.8"

    # Box
    config.vm.box = "ubuntu/trusty64"

    # Shared folders
    config.vm.synced_folder ".", "/srv"

    # Setup
    config.vm.provision :shell, :inline => "touch .hushlogin"
    config.vm.provision :shell, :inline => "hostnamectl set-hostname #{hostname} && locale-gen #{locale}"
    config.vm.provision :shell, :inline => "apt-get update --fix-missing"
    config.vm.provision :shell, :inline => "apt-get install -q -y g++ make git curl vim"

    # Lang
    # Provide additional packages/setup/etc
    ...
end

Configuration

Static IP

To add support for a static IP address to your box, add the following to the Vagrantfile after download:

# Network
config.vm.network :private_network, ip: "10.10.10.100"

NFS

If you prefer NFS to the default network filesystem provided by your VM, replace the # Shared folders lines in the Vagrantfile with the following. You will need a Static IP for this to work correctly.

# Shared folders
config.vm.synced_folder ".", "/srv", :nfs => true

Performance

It may be important to you to limit the performance hit to your local machine, or ensure enough memory is available to your provider. For example, the configuration below will limit the VM to using no more than 50% of your CPU and allocate up to 2GB of memory. Note: This example uses VirtualBox, but if you use a different provider such as VMWare, then this will be ignored safely.

  config.vm.provider :virtualbox do |v|
    v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
    v.customize ["modifyvm", :id, "--memory", 2048]
  end

License

The content of this library is released under the MIT License by Andrew Lawson.
You can find a copy of this license in LICENSE or at http://opensource.org/licenses/mit.

vagrantfiles's People

Contributors

adlawson avatar seanenck avatar wpillar avatar willia4 avatar rmasters avatar sjparkinson avatar ergl avatar jjhoyt avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.