Reputation: 1832
As far as I understand, Vagrant is used to serve web applications under different server configurations in order to mimic production environments during local development, but is it recommended to use Vagrant to be able to set up local development environments that do not actually run web applications themselves, but are used to write code, install npm packages, compile CSS, etc?
I know that some - if not many - people write code on the host machine, but as I am a heavy terminal user, I would prefer to move my local development environment to a VM which could then be reinstalled in a different machine in a matter of minutes. Whether this is one of the intended use cases for Vagrant seems really confusing to me.
P.S. This Vagrant VM would not run any web applications, i.e. it would not act as a web server, but rather as an isolated environment for development tools like vim, gulp, bower and others. I would prefer to spin up separate Vagrant VMs to serve my web applications.
Upvotes: 1
Views: 1214
Reputation: 2586
Using Vagrant to run a development environment that doesn't include running a web server is something I use pretty often, especially when a different OS from my host is preferred or required for development. This probably isn't the most common use for Vagrant, but it's a perfectly valid one.
For example, one of our products is Windows based so we use VisualStudio, but our laptops are all Macs. We have a Vagrant Windows all-in-one box which has the IDE, git, and the web server. This makes it trivial for developers to get up and running quickly or throw away their box and repave them.
While this works pretty well, the single box has too many responsibilities - both IDE and web server. We plan to break it out into separate Vagrant boxes, one for VisualStudio/dev environment and the other with a more production like web server configuration. This would also allow us to re-use the VisualStudio Vagrant box elsewhere if needed.
In addition to the Windows example I also have a couple of Linux dev boxes. I have a golang Vagrant dev box and a Kerberos dev box. While I could have just had Boxen configure these for me on my Mac, I felt it was cleaner and easier to have dedicated Vagrant dev boxes.
Upvotes: 2