Vagrant, Seems like a slow developing process

為{幸葍}努か 提交于 2019-12-11 12:15:56

问题


Im not sure if im understanding vagrant correctly but to my understanding its like a server running in a VM on your computer, which you use instead of your localhost to check to see if stuff is working because your local setup is slightly different to your servers. However is the quickest way to check updates, to git push from your local pc, then git pull on your vagrant VM then load up the website on your local pc to see changes, seems like it would become a painful process after a while compared to the local hosts CTRL+S f5 localhost website.


回答1:


I'll try to give a few hints:

its like a server running in a VM on your computer

Vagrant is not a server, its a tool to manage the VMs on your computer, it helps you start, provision, stop or destroy the vm for you. It abstracts the provider you're using (virtualbox, vmware, cloud provider or others) and makes it a single workflow for all your team members.

However is the quickest way to check updates, to git push from your local pc, then git pull on your vagrant VM then load up the website on your local pc to see changes

Not sure what you're working on but most likely, sync folder should help you avoid doing that. I already explain here how you can work with sync folder

Basically, when you use sync folder, when you modify a file from your host, the same file will be modified on the vm, so you do not need all the git things. Changes are not immediate but most people can accommodate.

as an example, you can add

config.vm.synced_folder "/Users/fhenri/project/examples/vagrant/ssh/www", "/var/www"

This will map my local folder /Users/fhenri/project/examples/vagrant/ssh/www with vm folder /var/www

Vagrant, Seems like a slow developing process

This might be a true and there are a few blogs (do not retrieve them at the moment) that deal with that. so what are the solutions ?

Depending the infrastructure you try to replicate using vagrant, but if you're a single developper you can check docker, if you're not confortable with docker, vagrant can really support you there and you can declare docker as vagrant provider, again there are a few blog post that deal with that with some benchmark, you can really benefit if you struggle with vagrant performance.

I hope it helps a bit



来源:https://stackoverflow.com/questions/32552875/vagrant-seems-like-a-slow-developing-process

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!