Git Product home page Git Product logo

magento2docker's Introduction

Magento2 Docker Environment

An Ideal Magento2 Development Environment OSX Centric. Key features of the project:

  • Simple Apache PHP container based on original images.
  • Ideal to work with multiple projects same time
  • Multi-project setup with clean host names. Based on external xip.io wildcard DNS server.
  • Provides real-time file synchronization by Mutagen
  • Includes PHPStorm container which can be rendered by X.ORG port for OSX
  • Includes great set of tools with zero configuration like Blackfire, XDebug.
  • Includes external services: ElasticSearch 2.x - 6.x, Redis, MailCatcher, RabbitMQ.
  • Provides Make tool as a wrapper. Simplify managing containers and support bash completion to hightlight commands.

Contents

Pre-requirements

Installation

You can download archive of this project on Release Page.

  • Clone or Download the repository git clone [email protected]:yvoronoy/magento2docker.git
  • Copy or create env/etc/composer/auth.json and put your Access Keys
    • cp env/etc/composer/auth.json.example env/etc/composer/auth.json
    • Edit env/etc/composer/auth.json and put your credentials Access Keys
  • Update your gitconfig if needed
    • cp env/etc/git/gitconfig.example env/etc/git/gitconfig
  • (Optional) Copy your private ssh keys, configs to have access to resources from inside container
    • cp ~/.ssh/id_rsa env/etc/ssh/
    • cp ~/.ssh/config env/etc/ssh/

Usage

Quick Start

Commands should be executed from env directory. Run make command to run environment.

# Build and mount containers (default: php-7.2)
make dev

# Login on web server container
make web

# Change php version
  - For php-7.0: make up70
  - For php-7.1: make up71
  - For php-7.2: make up72
  - For php-7.3: make up73
  - For php-7.4: make up74
  - For php-8.0: make up80

How to install a magento inside container

  • Login to container make web
  • Create a directory e.g: magento2
  • Inside the magento2 directory run m2install.sh -s composer -v 2.3.3
  • Open browser and go to http://magento2.127.0.0.1.xip.io/

How to deploy dumps (backups) inside container

  • Put dumps to src folder on your host machine
    • Login to container make web
    • Run m2install.sh

How to Enable xDebug

The container already includes PHP xDebug extension. The xDebug extension is disabled by default because it is dramatically decrease performance.

Usage

  • Login to your container make web
  • Run command xdebug-php.sh 1
  • Run IDE (PHPStorm) and press button Start Listening for PHPDebug Connection

Persistent folders

Any file saved out of these folders will be lost when the container is terminated

  • var/www/html
  • home/magento
  • /root/.composer/cache

How to start using Blackfire

Blackfire Profiler is a PHP profiler and automated performance testing tool. It enables you to investigate performance issues in very simple way, just install a browser extension and press the button. You will get granular performance report to measure CPU, IO, Memory, Network, etc. Profiling with Blackfire is on-demand. This means that Blackfire adds no overhead for your end users, which makes it safe to use in production.

Get your Blackfire credentials

Blackfire provides you a free account "Hack" which allows you to run profiles on your development environment.

How to run PHPStorm inside container

Pre-requirements

  • Install and setup XQuartz
    • Install brew cask install xquartz
    • Open open -a XQuartz and go to X11 Preferences
      • Goto Security tab and check Allow connections from network clients
      • Restart computer

Usage

Run the following command inside env directory

make phpstorm

Todo List

Contributing

  1. Fork this repository.
  2. Create your feature branch: git checkout -b my-new-feature.
  3. Commit your changes: git commit -am 'Add some feature'.
  4. Push to the branch: git push origin my-new-feature.
  5. Submit a pull request.

Credits

Special thanks to @snosov and @tshabatyn who share their ideas and inspired to build this project.

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.