Can someone explain the Homestead.yaml file in details. Not fully understanding its contents is bothering me.
Here is the complete Homestead yaml file:
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Code
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
And here is what I understand about its content, correct me if I'm wrong and of course add comments.
authorize: ~/.ssh/id_rsa.pub
A directory in your local machine where you store the public .ssh file. This folder can be any folder in your local machine, right?keys: - ~/.ssh/id_rsa
A directory in your local machine where you store the local .ssh file. This folder can be any folder in your local machine, right?folders:
- map: ~/Code
to: /home/vagrant/Code
-map: A directory in your local machine where you store all of your porjects. This folder can be any folder in your local machine, right?
to: I believe this is where your projects will be stored in the virtual machine, if this is correct, does the last folder needs to match the last folder in the local structure?
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
-map: I believe this is the url or domain you will be using to get to your site and it can be anything you want as long as you add it to your localhost file, correct?
to: I'm not sure what this is...
databases:
- homestead
A databese called homestead will be created automatically, correct?
Thanks
Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine. Vagrant provides a simple, elegant way to manage and provision Virtual Machines.
The yaml file goes in C:\Users\YourUserName\. homestead\ as mentioned above.
reload homestead vagrant ssh locate new directory within homestead 'project' create laravel project within this directory and call it something random 'random' I now have a new laravel project inside the following directory 'project/random' Go into finder, move all project files and directories from 'random' into ' ...
Though I am late to answer but I recently installed Homestead and Homestead.YAML was hard to understand as official documentation is lacking. Stumbled upon a very good article but its too long to copy here so I will just provide a link to it, Hope it may help newbies.
https://abbasharoon.me/homestead-yaml-explained-a-z/
You can also add an options
element to the map/to
elements in the folder
element, as in the example below, and to that, specify a range of options, which are documented in the Vagrant documentation.
- map: ~/Workspace/my/mapped/directory
to: /home/vagrant/my/directory
options:
owner: "www-data"
group: "www-data"
mount_options: ["dmode=0770,fmode=774"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With