Skip to content

Instantly share code, notes, and snippets.

@seiji
Last active January 25, 2021 07:31
Show Gist options
  • Save seiji/0f351d7b06eaa9e1f3c892820519a8a2 to your computer and use it in GitHub Desktop.
Save seiji/0f351d7b06eaa9e1f3c892820519a8a2 to your computer and use it in GitHub Desktop.
Vagrantfile
def install_plugin(plugin)
system "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin
end
%w(vagrant-disksize vagrant-env vagrant-hostsupdater vagrant-docker-compose).each do |plugin|
install_plugin(plugin)
end
Vagrant.configure("2") do |config|
config.env.enable
config.vm.box = "ubuntu/xenial64"
config.vm.hostname = 'default'
config.vm.network :private_network, ip: '192.168.50.10'
config.vm.provider :virtualbox do |vb|
vb.gui = false
vb.cpus = 6
vb.memory = 8192
vb.customize ['modifyvm', :id, '--natdnsproxy1', 'off']
vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'off']
end
config.vm.provision :docker, run: 'always'
config.vm.provision :docker_compose
config.vm.provision "shell", inline: <<-SHELL
echo 'AcceptEnv *' >>/etc/ssh/sshd_config
service ssh restart
SHELL
config.vm.synced_folder './', '/home/vagrant/shared'
config.disksize.size = '30GB'
config.ssh.forward_env = [
'AWS_ACCESS_KEY_ID',
'AWS_DEFAULT_REGION',
'AWS_SECRET_ACCESS_KEY',
'COMPOSE_DOCKER_CLI_BUILD',
'DOCKER_BUILDKIT'
]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment