Skip to content

Instantly share code, notes, and snippets.

@marshyski
Last active April 14, 2016 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marshyski/e89f80f7b7fd29ae6b0e to your computer and use it in GitHub Desktop.
Save marshyski/e89f80f7b7fd29ae6b0e to your computer and use it in GitHub Desktop.
My Stack
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
echo "vm.swappiness=0" >> /etc/sysctl.conf
echo "kernel.randomize_va_space=1" >> /etc/sysctl.conf
echo "vm.dirty_ratio=3" >> /etc/sysctl.conf
echo "vm.dirty_background_ratio=2" >> /etc/sysctl.conf
echo "vm.overcommit_memory=1" >> /etc/sysctl.conf
echo "vm.mmap_min_addr=4096" >> /etc/sysctl.conf
echo "never" > /sys/kernel/mm/transparent_hugepage/defrag
echo "never" > /sys/kernel/mm/transparent_hugepage/enabled
sysctl -p
echo '* hard nofile 999999' >> /etc/security/limits.conf
echo '* soft nofile 999999' >> /etc/security/limits.conf
echo 'nameserver 8.8.8.8' > /etc/resolvconf/resolv.conf.d/base
resolvconf -u
apt-get update -y
apt-get upgrade -y
apt-get install -y python-dev nginx git golang ruby-dev python-setuptools python-pip npm
ln -s /usr/bin/nodejs /usr/bin/node
npm install -g bower grunt_cli
curl -sSL https://get.docker.com/ | sh
systemctl enable docker
docker run -d --name elasticsearch elasticsearch
docker run -d --name redis -p 0.0.0.0:6379:6379 redis
# docker run -d --name dockerui -p 9000:9000 --privileged -v /var/run/docker.sock:/var/run/docker.sock dockerui/dockerui
# docker run -v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys:ro -v /var/lib/docker/:/var/lib/docker:ro -p 8000:8080 -d true --name cadvisor google/cadvisor:latest
gem install fpm --no-rdoc --no-ri
systemctl enable nginx
wget http://yum.appitize.io/plural
mkdir -p /opt/plural/conf
wget http://yum.appitize.io/plural.yaml -O /opt/plural/conf/plural.yaml
chmod -f 0755 plural
./plural
SCRIPT
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/wily64"
config.vm.hostname = "#{ENV['USER']}"
config.vm.network :private_network, ip: "10.20.1.15"
config.vm.network "forwarded_port", guest: 5000, host: 5000, auto_correct: true
config.vm.network "forwarded_port", guest: 8000, host: 8000, auto_correct: true
config.vm.network "forwarded_port", guest: 8080, host: 8080, auto_correct: true
config.vm.network "forwarded_port", guest: 9000, host: 9000, auto_correct: true
config.vm.network "forwarded_port", guest: 9200, host: 9200, auto_correct: true
config.vm.network "forwarded_port", guest: 6379, host: 6379, auto_correct: true
vagrantdir = File.dirname(__FILE__)
stackdir = "#{ENV['HOME']}"
link = File.expand_path('.files', vagrantdir)
Dir.mkdir(stackdir, 0755) unless File.exists?(stackdir)
File.symlink(stackdir, link) unless File.symlink?(link)
config.vm.synced_folder ".files", "/vagrant"
config.vm.provider "virtualbox" do |v|
v.name = "#{ENV['USER']}"
v.memory = 4096
v.cpus = 4
end
config.vm.provision "shell", inline: $script, privileged: true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment