![]() ![]() For example, I have a script that takes the base image, installs python3, pip3, various pip-based packages, mysql, creates a mysql database owned by a specific username/password, copies an apache config file into place, then restarts apache. You can test your script by constantly destroying the vm vagrant destroy and bringing it back up vagrant up. Vagrant will call this when creating the VM. Start with the base VM and record a shell script (or puppet manifest like I like to do) that installs and configures all the applications you use. You can make your exact development environment reproducible. If you are sharing your work with others, there's another part of using Vagrant that comes in handy. Now within the VM you can install any version of python you want, as well as web servers (nginx/apache), database servers (mysql/postgresql), or any other supporting software (redis/rabbitmq).Īt the end of your programming session, you can suspend the VM to disk and leave it right where you left off. The contents of your project directory (the same directory containing the Vagrantfile) are mounted within the VM as /vagrant. You may have to fiddle with P圜harm's remote path mappings a bit to get everything working. You can ssh into this this VM, and P圜harm has a number of hooks for Vagrant and Remote Interpreters. This takes a base virtualbox image and fires it up. Basically, in my project directory I have a file called "Vagrantfile". But now that I'm at a point where my laptops and workstations have 8gb of ram or more (and plenty of processing power), running a virtual machine (or 3) for each development project becomes exceedingly ideal.įor my MacBook, I use P圜harm + VirtualBox + Vagrant. For years, I would always be installing multiple interpreters, database servers, all manner of supporting (and occasionally conflicting) libraries onto my workstation. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |