mirror of
https://codeberg.org/scottslowe/learning-tools.git
synced 2026-03-11 09:04:37 +00:00
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.
34 lines
1 KiB
Ruby
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
|