-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
48 lines (38 loc) · 1.42 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.network "forwarded_port", guest: 80, host: 80
config.vm.provider "virtualbox" do |v|
v.name = "5genesis-portal"
v.memory = 2048
end
config.vm.provision "shell", privileged: false, inline: <<-SHELL
# Exit on error
set -e
# Install required packages
sudo apt-get -y update
sudo apt-get -y install python3.7 python3.7-venv python3.7-dev python3-pip
sudo apt-get -y install supervisor nginx git
python3.7 -m pip install pip
SHELL
# Reload shell in order to be able to use pip3.7
config.vm.provision "shell", privileged: false, inline: <<-SHELL
# Exit on error
set -e
# Install requirements. Please consider using virtualenv when installing on a shared machine.
cd /vagrant
pip3.7 install -r requirements.txt --user
pip3.7 install gunicorn --user
# Configure supervisor
sudo cp /vagrant/Vagrant/supervisor.conf /etc/supervisor/conf.d/5gportal.conf
sudo supervisorctl reload
# Configure nginx (no ssl, see Vagrant/nginx_ssl.conf for an https configuration example)
sudo rm /etc/nginx/sites-enabled/default
sudo cp /vagrant/Vagrant/nginx.conf /etc/nginx/sites-enabled/5gportal
sudo service nginx reload
SHELL
config.vm.post_up_message = <<-MESSAGE
5Genesis Portal should be accessible at localhost (port 80)
MESSAGE
end