Git Product home page Git Product logo

magento-devenv's Introduction

devenv.sh environment for Magento 2 development

devenv it's a powerful development environment based on NixOS.
It allows you to have containerized environments without containers or hypervisor or emulation, with native performance on any platform.
This is by far the fasted Magento/Openmage development environment I've ever worked with and it's more than worth of the time to learn it.

This repo has a basic (and yet complete) OpenMage project installed via composer and all of the necessary software stack:

  • PHP 8.2 (managed by PHP-FPM and served by Caddy)
  • MySQL 8.0
  • Redis 7.0
  • OpenSearch 2.6
  • Xdebug 3.2
  • MailHog for email testing
  • n98-magerun2

Compatibility

This branch is only compatible with Magento 2.4.6 because of the need for OpenSearch2 support (since ElasticSearch7 is broken in NixOS).

Install the environment

  1. If you don't have devenv/NixOS installed please follow devenv's installation guide, it's actually pretty easy and straightforward.
  2. Then clone this repository to have all the configuration files on your machine

Install Magento 2

  1. Edit DOMAIN and DEV_DOMAIN in .devenv to your local development domain.
  2. Start all services with devenv up
  3. Open another terminal
  4. Enter the development environment shell with devenv shell
  5. Create the magento project in the magento2 folder with composer composer create-project --repository-url=https://mirror.mage-os.org/ magento/project-community-edition:2.4.6 magento2 (I'd prefer MageOS but at the moment 2.4.6 is not available on their repos)
  6. cd [Magento Folder]
  7. composer install
  8. Install sample data if you want
  9. bin/magento setup:install --base-url='https://magento2.local' --db-host='127.0.0.1' --db-user='magento2' --db-password='magento2' --db-name='magento2' --admin-firstname='admin' --admin-lastname='admin' --admin-email='[email protected]' --admin-user='admin' --admin-password='admin123' --language='en_US' --currency='EUR' --timezone='Europe/Rome' --use-rewrites='1' --backend-frontname='admin' --session-save=redis --session-save-redis-host='127.0.0.1' --session-save-redis-port='6379' --session-save-redis-db='0' --cache-backend-redis-server='127.0.0.1' --cache-backend-redis-port='6379' --cache-backend-redis-db='1' --page-cache-redis-server='127.0.0.1' --page-cache-redis-port='6379' --page-cache-redis-db='2' --opensearch-host='127.0.0.1' --opensearch-port='9200'

For existing Magento 2 project

  1. Edit DOMAIN and DEV_DOMAIN in .devenv to your local development domain.
  2. Start all services with devenv up
  3. Open another terminal
  4. Enter the development environment shell with devenv shell
  5. Copy existing project to sub directory as configured in .env
  6. cd [Magento Folder]
  7. composer install
  8. Edit app/etc/env.php file to match with configured.

Daily use

  1. Enter the project folder
  2. run devenv up to start all the software stack
  3. run devenv shell to enter a shell with all softwares configured properly (like n98-magerun2)

At the moment the project is configured with http://magento2.test as the main domain name (you can change it in the devenv.nix file), so you'll have to add magento2.testto your hosts file first, then you'll be able to open the browser to http://magento2.test.

magento-devenv's People

Contributors

s5k avatar

Stargazers

magepsycho avatar

Watchers

 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.