Created
June 22, 2016 07:57
-
-
Save aliaspooryorik/794755196ac3fa4ba9c9aa64da5e3061 to your computer and use it in GitHub Desktop.
Vagrant / commandbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.provider "virtualbox" do |vb| | |
vb.gui = false | |
end | |
if Vagrant.has_plugin?("vagrant-cachier") | |
config.cache.scope = :box | |
end | |
config.vm.define :commandbox do |commandbox_config| | |
commandbox_config.vm.network "private_network", ip: "192.168.56.60" | |
commandbox_config.vm.hostname = "www.commandbox.local" | |
commandbox_config.vm.provider "virtualbox" do |vb| | |
vb.memory = "1000" | |
end | |
commandbox_config.vm.provision "shell", inline: <<-SHELL | |
sudo bash | |
export DEBIAN_FRONTEND=noninteractive | |
# Change this to whatever you want your localtime to be | |
sudo ln -fs /usr/share/zoneinfo/Europe/London /etc/localtime | |
# Add some more sources to apt-get | |
apt-get update | |
apt-get -q -y --force-yes install python-software-properties | |
echo "deb http://downloads.ortussolutions.com/debs/noarch /" > /etc/apt/sources.list.d/box.list | |
add-apt-repository -y ppa:webupd8team/java | |
apt-add-repository -y ppa:chris-lea/node.js | |
apt-get update | |
# Install dependencies | |
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections | |
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections | |
apt-get install -q -y --force-yes oracle-java8-installer | |
apt-get install -q -y --force-yes oracle-java8-set-default | |
apt-get install -q -y --force-yes nodejs | |
apt-get install -q -y --force-yes commandbox | |
# Start up the server | |
cd /vagrant | |
box install --production | |
SHELL | |
commandbox_config.vm.provision "shell", inline: <<-SHELL, run: "always" | |
# Start up the server | |
cd /vagrant | |
box server set web.http.port=80 | |
box server set web.host=0.0.0.0 | |
box server set runwar.args="--sendfile-enable false" | |
box server set jvm.heapsize=512 | |
box server set openbrowser=false | |
box start | |
SHELL | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment