This is the situation: my main dev setup is Windows based and 99.999% of my deployments are Linux based, so I often encounter issues related to that something Windows has that Linux doesn't or vice versa. To mitigate this issues you have as many options as your creativity goes. To mention some, here are some ideas in no special order:
- Create a Virtualbox/Vmware player/HyperV machine, install your target Linux distro and deploy your application
- Deploy a Linux based droplet in the cloud like AWS/Digital Ocean/Linode and do the same
- Deploy a local or remote Docker Container
- Laravel Vapor is also an option
All of these options, paid or not, will serve its purpose which is to test thoroughly your application in a staging environment before going live. It's always recommended that do so in an environment as close as the target environment, so I present to you my current recommended option: Laravel Homestead.
Homestead: What is it?
In simple terms, it is a preinstalled - preconfigured Linux system in which you can easily deploy your application for testing purposes.
What are the underlying components?
For Laravel Homestead to work it uses VirtualBox by default, Vagrant as the box automation and deployment software and inside the box you will have available by default an NIGNX web server with several versions of PHP and a MySQL server instance ready to use. All of this in an Ubuntu based installation (text only - no GUI).
you can add more functionality and packages as needed. Remember this is an Ubuntu Linux installation after all.
Do you have to care if this is a full VM instead of a Docker Container?
Absolutely not. but, in case you prefer a Docker container then you should only keep reading if the topic is of interest to you.
Vagrant boxes work in a similar way that a Docker container does. The difference is that these are VirtualBox images. The similarity is that you have a configuration file fully customizable by you to suit your needs.
Do you mind this is an Ubuntu based install?
You don't have to. Bear with me. I'm not a fan of Ubuntu distro, I really prefer SuSE or Debian by far. For what we are going to accomplish here, it doesn't matter that much. What really matters is that you will be able to configure your VM with ease using the Homestead.yaml configuration file.
Now, let's dive in
What you can configure in your Homestead.yaml file?
- Virtual CPUs available to the VM
- RAM
- Mapped folders from your Host to the VM Guest
- DNS name for each of the applications you are going to test
- Server/Services you need or want
- Port forwarding
What can you configure outside of your Homestead.yaml file?
- aliases (command shortcuts)
- scripts to run after the VM is up
My configuration file looks like this:
---
ip: "192.168.56.56"
memory: 4096
cpus: 2
provider: virtualbox
authorize: ~/.ssh/jcrod_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
to: /home/vagrant/jcrodsolutions
- map: c:/webapps/jcrodsolutions
sites:
- map: jcrodsolutions.test
to: /home/vagrant/jcrodsolutions/public
databases:
- homestead
features:
- mysql: false
- mariadb: true
- postgresql: false
- ohmyzsh: false
- webdriver: false
services:
- enabled:
- "mysql"
ports:
- send: 80
to: 80
- send: 443
to: 443
Almost all of this is the default file, except the folder mapping.
Top comments (0)