Vagrantfile 1.03 KB
Newer Older
1 2 3
required_plugins = %w(vagrant-docker-compose)
required_plugins.each do |plugin|
    exec "vagrant plugin install #{plugin}; vagrant #{ARGV.join(" ")}" unless Vagrant.has_plugin? plugin || ARGV[0] == 'plugin'
Nick Sellen's avatar
Nick Sellen committed
4 5
end

Nick Sellen's avatar
Nick Sellen committed
6 7 8
ports = [
  18080, # main website
  18081, # phpmyadmin
9 10
  18084, # maildev. (changed, since 18083 is used by virtualbox (vboxwebsrv))

Nick Sellen's avatar
Nick Sellen committed
11 12 13 14 15 16 17
  # these two are not available for a default setup
  # check the README for instructions on setting them
  # if you want, they are optional
  18082, # foodsharing light
  18000  # django api
]

Nick Sellen's avatar
Nick Sellen committed
18
Vagrant.configure("2") do |config|
Tim Förster's avatar
Tim Förster committed
19
  
Nick Sellen's avatar
Nick Sellen committed
20
  config.vm.box = "ubuntu/trusty64"
Tim Förster's avatar
Tim Förster committed
21

Nick Sellen's avatar
Nick Sellen committed
22 23 24
  ports.each do |port|
    config.vm.network(:forwarded_port, guest: port, host: port)
  end
Tim Förster's avatar
Tim Förster committed
25

Nick Sellen's avatar
Nick Sellen committed
26
  config.vm.provision :shell, inline: "apt-get update"
Tim Förster's avatar
Tim Förster committed
27
  
28
  config.vm.synced_folder ".", "/vagrant", owner: "www-data", :mount_options => ["dmode=777","fmode=777"]
29
  
Nick Sellen's avatar
Nick Sellen committed
30
  config.vm.provision :docker
Tim Förster's avatar
Tim Förster committed
31
  config.vm.provision :docker_compose
Tim Förster's avatar
Tim Förster committed
32
  
Nick Sellen's avatar
Nick Sellen committed
33
  config.vm.provision "shell",
Tim Förster's avatar
Tim Förster committed
34
    inline: "cd /vagrant && ./scripts/start", run: 'always'
Tim Förster's avatar
Tim Förster committed
35
    
Nick Sellen's avatar
Nick Sellen committed
36
end
Tim Förster's avatar
Tim Förster committed
37 38