forked from cmheisel/docker-machine-fstest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
48 lines (40 loc) · 1.57 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
# A dummy plugin for DockerRoot to set hostname and network correctly at the very first `vagrant up`
module VagrantPlugins
module GuestLinux
class Plugin < Vagrant.plugin("2")
guest_capability("linux", "change_host_name") { Cap::ChangeHostName }
guest_capability("linux", "configure_networks") { Cap::ConfigureNetworks }
end
end
end
Vagrant.configure(2) do |config|
config.vm.define "fschangetest"
config.vm.box = "ailispaw/barge"
config.vm.network :private_network, ip: "192.168.56.10"
if "#{ENV['NFS']}" === "1" then
config.vm.synced_folder ".", "/vagrant", type: "nfs",
mount_options: ["nolock", "vers=3", "udp", "noatime", "actimeo=1"]
else
config.vm.synced_folder ".", "/vagrant"
end
config.vm.provision :docker do |docker|
docker.build_image "/vagrant", args: "-t alpine -f /vagrant/Dockerfile.alpine"
docker.run "alpine",
args: "-v /vagrant:/app -p 8000:5000",
cmd: "python app.py",
restart: false
docker.build_image "/vagrant", args: "-t slim -f /vagrant/Dockerfile.slim"
docker.run "slim",
args: "-v /vagrant:/app -p 8001:5000",
cmd: "python app.py",
restart: false
docker.build_image "/vagrant", args: "-t nginx-alpine -f /vagrant/Dockerfile.nginx-alpine"
docker.run "nginx-alpine",
args: "-v /vagrant:/usr/share/nginx/html -p 8002:80",
restart: false
docker.build_image "/vagrant", args: "-t nginx-jessie -f /vagrant/Dockerfile.nginx-jessie"
docker.run "nginx-jessie",
args: "-v /vagrant:/usr/share/nginx/html -p 8003:80",
restart: false
end
end