4
Vagrant.require_version ">= 1.6.0"
5
VAGRANTFILE_API_VERSION = "2"
7
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8
# Increase our guests RAM to 1GB (docker mysql will fail otherwise)
9
config.vm.provider "virtualbox" do |v|
13
config.vm.box = "ubuntu/trusty64"
14
config.vm.network :public_network, type: "dhcp"
16
# Mount the this folder to /data/web - set group permissions to www-data to give
17
# the docker cms-web instance write access
18
# NOTE: cms-db instance mounts /data/db inside the guest only. Data persists over vagrant restarts
19
# but we don't care about persisting externally if we vagrant destroy.
20
config.vm.synced_folder "./", "/data/web", id: "vagrant-web",
23
mount_options: ["dmode=775,fmode=664"]
26
config.vm.provision "docker" do |d|
27
d.pull_images "mysql:5.6"
28
d.pull_images "xibosignage/xibo-cms-dev:latest"
29
d.pull_images "xibosignage/xibo-xmr:latest"
32
args: "-p 3306:3306 -v /data/db:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=root"
34
image: "xibosignage/xibo-xmr:latest",
37
image: "xibosignage/xibo-cms-dev:latest",
38
args: "-p 80:80 -e XIBO_DEV_MODE=true -v /data/web:/var/www/cms -v /data/backup:/var/www/backup --link cms-db:mysql --link cms-xmr:50001"
41
# Run a shell provisioner to restart the docker cms-web container (to map the shared folder correctly)
42
config.vm.provision "shell",
43
inline: "docker restart cms-web",
46
# Install Dependencies
48
echo PHP5-CLI and CURL
49
apt-get install -y php5-cli php5-curl
51
wget -q https://getcomposer.org/composer.phar
52
mv composer.phar /usr/local/bin/composer
53
chmod 755 /usr/local/bin/composer
54
cd /data/web && composer install
55
echo Provisioning Build System
57
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
58
apt-get install -y nodejs
60
npm install --global gulp-cli
63
config.vm.provision "shell",
66
# Output the IP address for easy access to the VM
67
config.vm.provision "shell",
68
inline: "/sbin/ifconfig eth1 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'",