-
Notifications
You must be signed in to change notification settings - Fork 2
/
Vagrantfile
78 lines (56 loc) · 1.87 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
export DEBIAN_FRONTEND=noninteractive;
PHP_VERSION="7.1";
## Add Onrej PPA for php 5.6 - 7.2
add-apt-repository -y -u ppa:ondrej/php;
apt-get install git \
make \
unzip \
"php$PHP_VERSION" \
"php$PHP_VERSION-cli" \
"php$PHP_VERSION-common" \
"php$PHP_VERSION-zip" \
"php$PHP_VERSION-mbstring" \
"php$PHP_VERSION-opcache" \
"php$PHP_VERSION-curl" \
"php$PHP_VERSION-xml" \
"php$PHP_VERSION-intl" -y
PHP_INI_PATH="/etc/php/$PHP_VERSION/cli/conf.d/99-user.ini";
touch /var/log/php_error.log
chown vagrant:vagrant /var/log/php_error.log
touch "$PHP_INI_PATH";
echo "display_errors = On" >> "$PHP_INI_PATH";
echo "display_startup_errors = On" >> "$PHP_INI_PATH";
echo "error_reporting = E_ALL" >> "$PHP_INI_PATH";
echo "log_errors = On" >> "$PHP_INI_PATH";
echo "error_log = /var/log/php_error.log" >> "$PHP_INI_PATH";
SCRIPT
$composer = <<SCRIPT
COMPOSER_VERSION="1.7.2";
BIN_DIR="/home/vagrant/bin";
COMPOSER_FILE="$BIN_DIR/composer";
mkdir -p "$BIN_DIR" &&
wget -q -O "$COMPOSER_FILE" "https://getcomposer.org/download/$COMPOSER_VERSION/composer.phar" &&
chmod +x "$COMPOSER_FILE";
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.network :private_network, ip: "192.168.3.26"
config.vm.synced_folder ".", "/vagrant",
mount_options: ["actimeo=1"],
nfs: true,
linux__nfs_options: ["rw", "no_subtree_check", "all_squash", "async"]
if Vagrant::Util::Platform.windows? then
config.winnfsd.uid = 1000
config.winnfsd.gid = 1000
end
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
vb.cpus = 2
vb.name = "gplacesphp-api-client"
end
config.vm.provision "shell", inline: $script
config.vm.provision "shell", inline: $composer, privileged: false
end