scottslowe-learning-tools/vagrant-docker/Vagrantfile
Scott Lowe 81b1458b0f Add Ruby code to all Vagrantfiles
Add Ruby code to determine full path to supporting files referenced
in all Vagrantfiles. This will allow more effective use of Vagrant
commands when not in the same directory as the Vagrantfile.
2016-01-13 13:48:02 -07:00

34 lines
1 KiB
Ruby

# -*- mode: ruby -*-
# vi: set ft=ruby :
# Specify Vagrant version and Vagrant API version
Vagrant.require_version ">= 1.6.0"
VAGRANTFILE_API_VERSION = "2"
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'docker'
# Create and configure the Docker container(s)
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Disable synced folders for the Docker container
# (prevents an NFS error on "vagrant up")
config.vm.synced_folder ".", "/vagrant", disabled: true
# Configure the Docker provider for Vagrant
config.vm.provider "docker" do |docker|
# Define the location of the Vagrantfile for the host VM
# Comment out this line to use default host VM that is
# based on boot2docker
docker.vagrant_vagrantfile = "host/Vagrantfile"
# Specify the Docker image to use
docker.image = "nginx"
# Specify port mappings
# If omitted, no ports are mapped!
docker.ports = ['80:80', '443:443']
# Specify a friendly name for the Docker container
docker.name = 'nginx-container'
end # config.vm.provider
end # Vagrant.configure