forked from nwplus/gavel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
43 lines (32 loc) · 1.24 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
Vagrant.configure(2) do |config|
config.vm.box = 'debian/jessie64'
# synced folder
config.vm.synced_folder '.', '/gavel', type: 'rsync',
rsync__exclude: ['.git/', 'env/'],
rsync__args: ['--verbose', '--archive', '-z', '--copy-links']
# disable default synced folder
config.vm.synced_folder '.', '/vagrant', disabled: true
# port forward
config.vm.network 'forwarded_port', guest: 5000, host: 5000
# install packages
config.vm.provision 'shell', inline: <<-EOS
apt-get -y update
apt-get install -y \
postgresql-9.4 postgresql-server-dev-9.4 \
redis-server \
python3-dev python3-pip
pip3 install --upgrade pip
pip3 install virtualenv
EOS
# database setup
config.vm.provision 'shell', inline: <<-EOS
pg_auth_file="/etc/postgresql/9.4/main/pg_hba.conf"
echo "local all postgres peer" > "$pg_auth_file"
echo "local all all peer" >> "$pg_auth_file"
echo "host gavel vagrant ::1/128 trust" >> "$pg_auth_file"
echo "host gavel vagrant 127.0.0.1/32 trust" >> "$pg_auth_file"
service postgresql restart
su postgres -c "createdb gavel 2>/dev/null || true"
su postgres -c "createuser vagrant 2>/dev/null || true"
EOS
end