forked from IonosatMicro/promis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile.hostvm
59 lines (52 loc) · 2.01 KB
/
Vagrantfile.hostvm
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
#
# Copyright 2016 Space Research Institute of NASU and SSAU (Ukraine)
#
# Licensed under the EUPL, Version 1.1 or – as soon they
# will be approved by the European Commission - subsequent
# versions of the EUPL (the "Licence");
# You may not use this work except in compliance with the
# Licence.
# You may obtain a copy of the Licence at:
#
# https://joinup.ec.europa.eu/software/page/eupl
#
# Unless required by applicable law or agreed to in
# writing, software distributed under the Licence is
# distributed on an "AS IS" basis,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied.
# See the Licence for the specific language governing
# permissions and limitations under the Licence.
#
# This VM is only used when run for development purpose on non-Linux
# operating systems, or within Linux when the config is set to
# force the VM creation. This should not be used in production.
# Note the ports.
# Vagrant 1.8 required for docker and no parallel setting
# Inspiration drawn from: http://blog.scottlowe.org/2015/02/11/multi-container-docker-yaml-vagrant/
Vagrant.require_version ">= 1.8.0"
# In case of a lone start up
if !$conf
load "config.rb"
end
Vagrant.configure("2") do |config|
# Using vagrant's nonsecure keypair
# This only matters on non-Linux machines so who cares
# TODO: this doesn't seem to work though
config.ssh.insert_key = false
# Setting port forwarding, only useful in case we run a VM
# Ports lower than 1000 require root, so forward some
if $conf["port_web"] > 1000
config.vm.network :forwarded_port, :host => $conf["port_web"], :guest => $conf["port_web"]
else
# TODO remove this if not from a Vm
puts "Web port auto-corrected to 9080"
config.vm.network :forwarded_port, :host => 9080, :guest => $conf["port_web"]
end
# Expose Postgres
if $conf["expose_db"]
config.vm.network :forwarded_port, :host => $conf["port_sql"], :guest => $conf["port_sql"]
end
# Requesting a default boot2docker machine
config.vm.box = "dduportal/boot2docker"
end