Giter Club home page Giter Club logo

docker-magento2-light's Introduction

Docker build for magento development

Before start

In container php-fpm and nginx works by user www and group www with GUI and UID 7373 please create this user locally.

Start project

Create project dir

mkdir magento2 && cd magento2

Clone docker-compose repository

git clone [email protected]:pusachev/docker-magento2-light.git env/

Clone or copy your existing code

git clone {your-magento-code-repository} src/

or

mkdir src && copy /you/magento2 src/

Import database

zcat dump-magento2.sql.gz | mysql -P 3309 -h 127.0.0.1 -u root -proot magento

Copy env.php in your project

cd src/ && cp ../env/env.php app/etc/env.php

Install magento

Get magento from composer

docker exec -itu www php-fpm composer create-project --repository=https://repo.magento.com/ magento/project-community-edition /var/www/current/src

Install sample data

docker exec -itu www php-fpm /var/www/current/src/bin/magento sampledata:deploy

Install magento

docker exec -itu www php-fpm /var/www/current/src/bin/magento setup:install --base-url=http://magento2.test/ --db-host=mysql --db-name=magento --db-user=root --db-password=root --admin-firstname=Magento --admin-lastname=User [email protected] --admin-user=admin --admin-password=admin123 --language=en_AU --currency=AUD --timezone=Australia/Melbourne --cleanup-database --use-rewrites=1

Config cache by redis

Please add code in you env.php

...
 'cache' => [
        'frontend' => [
            'default' => [
                'backend' => 'Cm_Cache_Backend_Redis',
                'backend_options' => [
                    'server' => 'redis',
                    'database' => '0',
                    'port' => '6379'
                ],
            ],
            'page_cache' => [
                'backend' => 'Cm_Cache_Backend_Redis',
                'backend_options' => [
                    'server' => 'redis',
                    'port' => '6379',
                    'database' => '1',
                    'compress_data' => '0'
                ]
            ]
        ]
    ],
...

Config session save in redis

Please add code in you env.php

...
'session' =>
        [
            'save' => 'redis',
            'redis' =>
            [
                'host' => 'redis',
                'port' => '6379',
                'password' => '',
                'timeout' => '2.5',
                'persistent_identifier' => '',
                'database' => '2',
                'compression_threshold' => '2048',
                'compression_library' => 'gzip',
                'log_level' => '3',
                'max_concurrency' => '6',
                'break_after_frontend' => '5',
                'break_after_adminhtml' => '30',
                'first_lifetime' => '600',
                'bot_first_lifetime' => '60',
                'bot_lifetime' => '7200',
                'disable_locking' => '0',
                'min_lifetime' => '60',
                'max_lifetime' => '2592000'
            ]
        ],
...

docker-magento2-light's People

Contributors

pusachev 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.