2016-03-23 18:39:41 +01:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
2018-02-14 19:35:08 +01:00
|
|
|
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
|
|
|
VAGRANTFILE_API_VERSION = '2'
|
|
|
|
|
|
|
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
2019-08-30 07:33:12 +02:00
|
|
|
config.vm.box = 'ubuntu/bionic64'
|
2018-02-14 19:35:08 +01:00
|
|
|
config.vm.define 'fabmanager-devbox'
|
|
|
|
|
2019-08-30 07:33:12 +02:00
|
|
|
# Forward ports so services running in the virtual machine can be accessed by
|
|
|
|
# the host
|
2018-02-14 19:35:08 +01:00
|
|
|
[
|
|
|
|
3000, # rails/puma
|
|
|
|
9200, # elasticsearch
|
|
|
|
5432, # postgres
|
|
|
|
1080, # mailcatcher web ui
|
|
|
|
4040 # ngrok web ui
|
|
|
|
].each do |port|
|
|
|
|
config.vm.network "forwarded_port", guest: port, host: port
|
|
|
|
end
|
2016-03-23 18:39:41 +01:00
|
|
|
|
2019-09-25 21:08:15 +02:00
|
|
|
# nginx server
|
|
|
|
config.vm.network "forwarded_port", guest: 80, host: 8080
|
|
|
|
|
2019-08-30 07:33:12 +02:00
|
|
|
# Configuration to allocate resources fro the virtual machine
|
2018-02-14 19:35:08 +01:00
|
|
|
config.vm.provider 'virtualbox' do |vb|
|
2018-02-15 18:31:36 +01:00
|
|
|
vb.customize ['modifyvm', :id, '--memory', '2048']
|
2018-02-14 19:35:08 +01:00
|
|
|
end
|
2016-03-23 18:39:41 +01:00
|
|
|
|
2019-08-30 07:33:12 +02:00
|
|
|
# If you are using Windows o Linux with an encrypted volume stick with the
|
|
|
|
# configuration below for file syncronization
|
2018-02-14 19:35:08 +01:00
|
|
|
config.vm.synced_folder '.', '/vagrant', type: 'virtualbox'
|
2016-03-23 18:39:41 +01:00
|
|
|
|
2019-09-01 04:53:19 +02:00
|
|
|
# Copy default configuration files for the database conenction and the Rails application
|
2019-09-25 21:08:15 +02:00
|
|
|
config.vm.provision "file", source: "./config/database.yml.default", destination: "/vagrant/config/database.yml"
|
2019-09-01 04:53:19 +02:00
|
|
|
config.vm.provision "file", source: "./config/application.yml.default", destination: "/vagrant/config/application.yml"
|
|
|
|
|
2019-09-25 21:08:15 +02:00
|
|
|
# Copy default configuration files to allow reviewing the Docker Compose integration
|
|
|
|
config.vm.provision "file", source: "./docker/docker-compose.yml", destination: "/home/vagrant/docker-compose.yml"
|
|
|
|
config.vm.provision "file", source: "./docker/env.example", destination: "/home/vagrant/config/env"
|
|
|
|
config.vm.provision "file", source: "./docker/nginx.conf.example", destination: "/home/vagrant/config/nginx/fabmanager.conf"
|
|
|
|
config.vm.provision "file", source: "./docker/elasticsearch.yml", destination: "/home/vagrant/elasticsearch/config/elasticsearch.yml"
|
|
|
|
config.vm.provision "file", source: "./docker/log4j2.properties", destination: "/home/vagrant/elasticsearch/config/log4j2.properties"
|
|
|
|
|
2019-08-30 07:33:12 +02:00
|
|
|
## Provision software dependencies
|
2018-02-14 19:35:08 +01:00
|
|
|
config.vm.provision "shell", privileged: false, run: "once",
|
|
|
|
path: "provision/zsh_setup.sh"
|
2019-08-30 07:33:12 +02:00
|
|
|
|
2019-09-01 04:53:19 +02:00
|
|
|
config.vm.provision "shell", privileged: false, run: "once",
|
2019-08-30 07:33:12 +02:00
|
|
|
path: "provision/box_setup.zsh",
|
|
|
|
env: {
|
|
|
|
"LC_ALL" => "en_US.UTF-8",
|
|
|
|
"LANG" => "en_US.UTF-8",
|
|
|
|
"LANGUAGE" => "en_US.UTF-8",
|
|
|
|
}
|
2019-09-01 04:53:19 +02:00
|
|
|
|
|
|
|
config.vm.provision "shell", privileged: true, run: "once",
|
|
|
|
path: "provision/box_tuning.zsh"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|