add a Vagrantfile to setup the project

This commit is contained in:
Andreas Zweili 2017-10-08 14:09:17 +02:00
parent 9ef11e69c7
commit 2e7077e92e
1 changed files with 42 additions and 0 deletions

42
Vagrantfile vendored Normal file
View File

@ -0,0 +1,42 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
BOX_IMAGE = "debian/stretch64"
Vagrant.configure("2") do |config|
config.vm.define "web" do |subconfig|
subconfig.vm.box = BOX_IMAGE
subconfig.vm.hostname = "web"
subconfig.vm.network "forwarded_port", guest: 80, host: 8080
subconfig.vm.network "private_network", type: "dhcp"
subconfig.vm.provision "shell", inline: <<-SHELL
DEBIAN_FRONTEND=noninteractive
apt-get install -y php7.0 php7.0-mysql php7.0-xml mariadb-server
phpenmod mysqli
mysql < /vagrant/sql/remove_db.sql
mysql < /vagrant/sql/create_db.sql
mysql < /vagrant/sql/add_data.sql
if ! [ -L /var/www/html ]; then
rm -rf /var/www/html
ln -s /vagrant /var/www/html
fi
SHELL
end
config.vm.define "resources" do |subconfig|
subconfig.vm.box = BOX_IMAGE
subconfig.vm.hostname = "resources"
subconfig.vm.network "private_network", type: "dhcp"
subconfig.vm.provision "shell", inline: <<-SHELL
apt-get install -y git
SHELL
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
apt-get update
apt-get install -y apache2 avahi-daemon libnss-mdns
SHELL
end