Skip to content

philbirnie/magento2-7thst

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Magento 2.3 Development Environment

Author: Phil Birnie, info[at]7thstreetweb.com

Overview

This repo helps stand up a development environment for new or existing Magento 2.3 implementations on Ubuntu version Bionic Beaver.

Setup

Always

vagrant up

First Time Only

Unfortunately, Magento’s Composer package requires credentials; In /vagrant/conf/composer, please copy auth.json.template to auth.json with your Magento Marketplace public and private key. This is not the same as your login and password

Walk through the setup script.

Important! Do NOT use localhost. See: https://magento.stackexchange.com/questions/194828/magento-2-new-customer-account-form-not-working/211392#211392

Get a ☕... This is going to be a while.

Development Tips

The dev environment in Magento 2 can be slow. Here are some recommendations, many of which were pulled directly from the Magento documentation.

  1. Disable only FPC and Block Cache. Leave all others on. Turn all caches on for front-end development or testing
  2. Enable only the extensions that you need. Many of the analytics extensions are completely unnecessary.
  3. Opcache is enabled -- this appears to make a substantial difference.
  4. Under Stores -> Configuration -> Advanced -> Developer, bundle and concatenate JS/CSS when feasible. The excessive number of requests in Docker slows the site down substantially. (Obviously this is not feasible when doing FE work)
  5. Synced folders are disabled for performance reasons; if you wish to enable them, see instructions in Vagrant file. This also means that you will want to initially rsync after you get everything set up. Simply run this command from within the project root. scp -P 2222 -r [email protected]:/var/www/magento . (You may need to add your key to the vagrant box) For subsequent updates, (if not using your IDE, use rsync)

Deployment

Deploying to production:

  1. bin/magento maintenance:enable - Enable Maintenance Mode
  2. bin/magento setup:upgrade - Run setup Script (and clear cache)
  3. bin/magento setup:di:compile - Compile code
  4. bin/magento setup:static-content:deploy - Compile Static Content (CSS, JS, Assets)
  5. bin/magento maintenance:disable - Disable Maintenance Mode

Or... in a single line (for MageMojo, hence the php70):

php70 bin/magento maintenance:enable;\
php70 bin/magento setup:upgrade;\
php70 bin/magento setup:di:compile;\
php70 bin/magento setup:static-content:deploy;\
php70 bin/magento maintenance:disable

Stack

  1. MySQL: Percona, 5.7
  2. PHP-FPM: 7.2
  3. Nginx
  4. Ubuntu: 18.04

Benchmarks

Loading Products Page in Admin (with 0 products)
  1. Docker: 29s
  2. Vagrant: 2s

About

Magento 2.2 Development Environment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published