Giter Club home page Giter Club logo

magento2-7thst's Introduction

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

magento2-7thst's People

Contributors

philbirnie avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.