Skip to content

Instantly share code, notes, and snippets.

@vamdt
Created April 1, 2016 11:24
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 vamdt/5e23a36991a814f164056c79dc117ccc to your computer and use it in GitHub Desktop.
Save vamdt/5e23a36991a814f164056c79dc117ccc to your computer and use it in GitHub Desktop.
My common vagrant file
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "u14"
# config.vm.box_url = "http://mirrors.opencas.cn/ubuntu-vagrant/vagrant/trusty/20160323.1/trusty-server-cloudimg-amd64-vagrant-disk1.box"
config.vm.hostname = "vamdt"
# accessing "localhost:6699" will access port 6699 on the guest vm machine.
config.vm.network "forwarded_port", guest: 6699, host: 6699
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "11.11.12.12"
# sync 1 arg: local machine, 2 arg: vm machine
config.vm.synced_folder "path/to/projects", "/vagrant/projects"
# config vm properties
config.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.memory = "512"
end
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
config.vm.provision "shell", inline: <<-SHELL
sudo sed -i 's/archive/cn.archive/g' /etc/apt/sources.list
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install -y libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make build-essential git
sudo apt-get install -y esl-erlang
sudo apt-get install -y elixir
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment