-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
31 lines (24 loc) · 965 Bytes
/
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = 'digital_ocean'
config.vm.box_url = "https://github.com/devopsgroup-io/vagrant-digitalocean/raw/master/box/digital_ocean.box"
config.ssh.private_key_path = '~/.ssh/id_rsa'
config.vm.synced_folder ".", "/vagrant", type: "rsync"
config.vm.define "webserver", primary: false do |server|
server.vm.provider :digital_ocean do |provider|
provider.ssh_key_name = ENV["SSH_KEY_NAME"]
provider.token = ENV["DIGITAL_OCEAN_TOKEN"]
provider.image = 'ubuntu-22-04-x64'
provider.region = 'fra1'
provider.size = 's-1vcpu-1gb'
provider.privatenetworking = true
end
server.vm.hostname = "webserver"
end
config.vm.provision "shell", privileged: false, inline: <<-SHELL
sudo apt-get update
SHELL
config.vm.provision :docker
config.vm.provision :docker_compose, yml: "/vagrant/compose.yml", run: "always"
end