From 702e7dfaade37da59784dadfdd364c6560393ea9 Mon Sep 17 00:00:00 2001 From: VISHAKH Date: Fri, 12 Jan 2018 00:54:53 +0530 Subject: [PATCH] Edited this particular as per requirements --- Vagrantfile | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 08db68b26..0d64287a9 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -11,7 +11,7 @@ Vagrant.configure("2") do |config| # https://docs.vagrantup.com. # Every Vagrant development environment requires a box. You can search for - # boxes at https://atlas.hashicorp.com/search. + # boxes at https://vagrantcloud.com/search. config.vm.box = "centos/7" # Disable automatic box update checking. If you disable this, then @@ -22,7 +22,13 @@ Vagrant.configure("2") do |config| # Create a forwarded port mapping which allows access to a specific port # within the machine from a port on the host machine. In the example below, # accessing "localhost:8080" will access port 80 on the guest machine. - config.vm.network "forwarded_port", guest: 8080, host: 8484 + # NOTE: This will enable public access to the opened port + config.vm.network "forwarded_port", guest: 8080, host: 8484 + + # Create a forwarded port mapping which allows access to a specific port + # within the machine from a port on the host machine and only allow access + # via 127.0.0.1 to disable public access + # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" # Create a private network, which allows host-only access to the machine # using a specific IP. @@ -37,11 +43,7 @@ Vagrant.configure("2") do |config| # the path on the host to the actual folder. The second argument is # the path on the guest to mount the folder. And the optional third # argument is a set of non-required options. - # config.vm.synced_folder "../data", "/vagrant_data" - config.vm.synced_folder ".", "/vagrant", disabled: true - config.vm.provision :shell, path: "bootstrap.sh" - config.vm.provision :file, source: "target/spring-petclinic-1.4.2.jar", destination: "/tmp/spring-petclinic-1.4.2.jar", run: "always" - config.vm.provision :shell, inline: "java -jar /tmp/spring-petclinic-1.4.2.jar &", run: "always" + config.vm.synced_folder ".", "/home/vagrant/sync", disabled: true # Provider-specific configuration so you can fine-tune various # backing providers for Vagrant. These expose provider-specific options. @@ -58,17 +60,12 @@ Vagrant.configure("2") do |config| # View the documentation for the provider you are using for more # information on available options. - # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies - # such as FTP and Heroku are also available. See the documentation at - # https://docs.vagrantup.com/v2/push/atlas.html for more information. - # config.push.define "atlas" do |push| - # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" - # end - # Enable provisioning with a shell script. Additional provisioners such as # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the # documentation for more information about their specific syntax and use. - # config.vm.provision "shell", inline: <<-SHELL + config.vm.provision :shell path: "bootstrap.sh" + config.vm.provision :file, source: "target/spring-petclinic-1.4.2.jar", destination: "/tmp/spring-petclinic-1.4.2.jar", run: "always" + config.vm.provision :shell, inline: "java -jar/tmp/spring-petclinic-1.4.2.jar &", run: "always" # apt-get update # apt-get install -y apache2 # SHELL