Git Product home page Git Product logo

docker-magento's Introduction

Supported tags and respective Dockerfile links

Production build

Sandbox build

What is this ?

Docker container built with CentOS 7, NGINX and PHP with compatible version and modules for Magento

Sandbox build for Magento 2.x (2-dev) comes with composer, nodejs, grunt.

These are the Docker Hub autobuild images located here.

How to start

The Simplest way, NginX - PHP-FPM by default

  1. Pull the latest image
$ docker pull locnh/docker-magento
  1. Create container
$ docker run --name magento -v /path/to/magento:/var/www/html -p 80:80 -d locnh/docker-magento

That's it !

More Options

Using Apache (httpd) instead of NginX

  • Just add the environment variable with -e WEB_SRV=apache or -e WEB_SRV=httpd

  • Example:

    $ docker run --name magento -e WEB_SRV=httpd -v /path/to/magento:/var/www/html -p 80:80 -d locnh/docker-magento
    

Set the uid (and/or gid) of apache inside container

  • To change the apache uid, use -e UID=<your uid> (you can use this).

  • To change the apache gid, use -e GID=<your gid> (use at your own risk).

  • Example:

    $ docker run --name magento -e UID=501 -v /path/to/magento:/var/www/html -p 80:80 -d locnh/docker-magento
    

Enable Xdebug remote (Sandbox build only)

  • Just add the environment variable with -e XDEBUG_RHOST=<REMOTE_HOST>.

  • Example your IDE is running at IP 10.0.75.1:

    $ docker run --name magento -e XDEBUG_RHOST=172.17.0.1 -v /path/to/magento:/var/www/html -p 80:80 -d locnh/docker-magento
    

Mountable Volumes

Beside Webroot /var/www/html, you can use option -v to mount more volumes to the container such as services logs:

  • NginX logs: /var/log/nginx
  • Apache logs: /var/log/httpd
  • PHP-FPM logs: /var/www/php-fpm

Please keep in mind

If you don't specify tag, default tag is latest. In case you need the build for specified version of magento, use the version as tag. For example, if you need a container to run:

  • Magento 2.x:

    $ docker run --name magento -v /path/to/magento:/var/www/html -p 80:80 -d locnh/docker-magento:2
    
  • Magento 1.x:

    $ docker run --name magento -v /path/to/magento:/var/www/html -p 80:80 -d locnh/docker-magento:1
    

Contribute

  1. Fork me
  2. Make changes
  3. Create pull request
  4. Grab a cup of coffee

docker-magento's People

Contributors

locnh avatar

Stargazers

Hieu Nguyen avatar  avatar Luan Ngo Minh avatar Tim Man avatar Milan Simek avatar  avatar Hieu Dang avatar Trương Thị Hiền avatar Dustin Tran avatar

Watchers

James Cloos 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.