-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
62 lines (52 loc) · 2.27 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/xenial64"
# Forward Flask and Kubernetes ports
config.vm.network "forwarded_port", guest: 5000, host: 5000, host_ip: "127.0.0.1"
config.vm.network "private_network", ip: "192.168.33.10"
# Provider-specific configuration
config.vm.provider "virtualbox" do |vb|
# Customize the amount of memory on the VM:
vb.memory = "1024"
vb.cpus = 1
# Fixes some DNS issues on some networks
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
# Copy your .gitconfig file so that your git credentials are correct
if File.exists?(File.expand_path("~/.gitconfig"))
config.vm.provision "file", source: "~/.gitconfig", destination: "~/.gitconfig"
end
# Copy your ssh keys for github so that your git credentials work
if File.exists?(File.expand_path("~/.ssh/id_rsa"))
config.vm.provision "file", source: "~/.ssh/id_rsa", destination: "~/.ssh/id_rsa"
end
if File.exists?(File.expand_path("~/.ssh/id_rsa.pub"))
config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/id_rsa.pub"
end
# Copy your IBM Clouid API Key if you have one
if File.exists?(File.expand_path("~/.bluemix/apiKey.json"))
config.vm.provision "file", source: "~/.bluemix/apiKey.json", destination: "~/.bluemix/apiKey.json"
end
# Copy your .vimrc file so that your VI editor looks right
if Dir.exists?(File.expand_path("~/.vim"))
config.vm.provision "file", source: "~/.vim", destination: "~/.vim"
end
######################################################################
# Setup a Python development environment
######################################################################
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y git zip tree python-pip python-dev
apt-get -y autoremove
pip install --upgrade pip
# Install app dependencies
cd /vagrant
sudo pip install -r requirements.txt
SHELL
end