How to use this box with Vagrant:
Vagrant.configure("2") do |config|
config.vm.box = "basantmandal/HK2_Vagrant_Magento2.4.2"
config.vm.box_version = "1.0.1"
end
vagrant init basantmandal/HK2_Vagrant_Magento2.4.2 \
--box-version 1.0.1
vagrant up
This version was created over 2 years ago.
Please use RSYNC or NFS for better Performance
Includes all major components required for Magento2.4.2 Development ✨-
vagrant ssh
sudo nano /etc/hosts
192.168.56.11 www.magento242.vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "basantmandal/HK2_Vagrant_Magento2.4.2"
config.vm.box_version = "1.0.1"
config.vm.network "private_network", ip: "192.168.56.11"
# Default HTTP port
config.vm.network "forwarded_port", guest: 80, host: 8080, auto_correct: true
config.vm.network "forwarded_port", guest: 443, host: 8443, auto_correct: true
# MySQL Port
config.vm.network "forwarded_port", guest: 3306, host: 3306
# Redis Port
config.vm.network "forwarded_port", guest: 6379, host: 6379, auto_correct: true
# Elastic Search Port
config.vm.network "forwarded_port", guest: 9200, host: 9200, auto_correct: true
config.vm.provider "virtualbox" do |vb|
# Customize CPU, Ram, Vbox Name & Disable Audio
vb.cpus = 2
vb.memory = "7168"
vb.name = "Magento242"
vb.customize ["modifyvm", :id, "--audio", "none"]
# Fixing issue of VM loosing sync of the date and time while sleeping.
vb.customize ['guestproperty', 'set', :id, '/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold', 10000]
end
# Share Local Folder with Vagrant Shared Folder
config.vm.synced_folder "/var/www/magento242", "/var/www/magento242", owner: "vagrant", group: "www-data"
# Provision - Clean Magento Logs & Other Logs
config.vm.provision "shell", privileged: true, inline: <<-SHELL
echo $(tail -5000 /var/www/magento242/var/log/exception.log) >/var/www/magento242/var/log/exception.log
echo $(tail -5000 /var/www/magento242/var/log/system.log) >/var/www/magento242/var/log/system.log
echo $(tail -5000 /var/www/magento242/var/log/cron.log) >/var/www/magento242/var/log/cron.log
echo $(tail -5000 /var/www/magento242/var/log/debug.log) >/var/www/magento242/var/log/debug.log
sudo rm -rf /var/log/*.gz
git config --global user.name "Basant Mandal" && git config --global user.email basantmandal@techbasant.in && git config --global credential.helper store
SHELL
# Run When Vagrant Up
config.trigger.before [:up, :provision] do |trigger|
trigger.info = "Running Up Trigger"
trigger.run = {path: "after_up.sh"}
end
# Run When Vagrant Halt
config.trigger.before [:destroy, :halt] do |trigger|
trigger.info = "Running Halt Trigger"
trigger.run = {path: "after_down.sh"}
end
end