-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
58 lines (50 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
49
50
51
52
53
54
55
56
57
58
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
# Params
domain="seabattle.test"
ip="192.168.201.65"
# Installs required plugins if not installed
if ARGV.include?('up') || ARGV.include?('reload')
plugins = [
'vagrant-docker-compose',
'vagrant-hostmanager'
].select do |plugin|
!Vagrant.has_plugin?(plugin)
end.join(' ')
if plugins.length > 0
system 'vagrant plugin install ' + plugins
system 'vagrant up'
exit true
end
end
# Configures machines
Vagrant.configure("2") do |config|
config.vm.box = "envimation/ubuntu-xenial-docker"
config.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.memory = 2048
end
config.vm.network :private_network,
ip: ip
config.vm.network :forwarded_port,
guest: 80,
host: 80,
host_ip: ip,
auto_correct: false
config.hostmanager.enabled = true
config.hostmanager.manage_host = true
config.hostmanager.manage_guest = true
config.hostmanager.ignore_private_ip = false
config.hostmanager.include_offline = true
config.hostmanager.aliases = [
domain
]
config.vm.provision :docker
config.vm.provision :docker_compose,
yml:
-"/vagrant/docker-compose.demo.yml",
rebuild: true,
project_name: "SeaBattle",
run: "always"
end