GithubHelp home page GithubHelp logo

juliancheckbox / docker-magento Goto Github PK

View Code? Open in Web Editor NEW

This project forked from meanbee/docker-magento

0.0 1.0 0.0 151 KB

๐Ÿณ Docker containers with all required Magento dependencies installed available as Apache and CLI

Dockerfile 56.52% Shell 31.39% PHP 12.10%

docker-magento's Introduction

meanbee/magento

Build Status Docker Build Status Docker Pulls Docker Stars

A collection of Docker images for running Magento application web servers and command line tools.

Supported tags and respective Dockerfile links

Usage

Since Magento requires several services working together, it recommended to use docker-compose with these images.

See docker-compose.yml for a sample configuration.

Options

Sendmail

All images have sendmail installed for emails, however it is not enabled by default. To enable sendmail, use the following environment variable:

ENABLE_SENDMAIL=true

Note: If sendmail has been enabled, make sure the container has a hostname assigned using the hostname field in docker-compose.yml or --hostname parameter for docker run. If the container does not have a hostname set, sendmail will attempt to discover the hostname on startup, blocking for a prolonged period of time.

Xdebug

Xdebug is installed and enabled on all the images by default. To configure it for remote debugging, start the container with the following environment variable set (replacing the {} placeholders with appropriate values):

XDEBUG_CONFIG="remote_connect_back=1 remote_enable=1 idekey={IDEKEY}"

Note: If you're using PhpStorm, your IDE Key is probably phpstorm.

Command Line Tools

The cli images have a number of useful Magento tools pre-installed:

  • composer - Install and manage PHP package dependencies
  • mageconfigsync - Backup and restore Magento System Configuration
  • magedbm - Create development backups of the Magento database using S3 and import them
  • magemm - Sync media images from an S3 backup
  • modman - Install Magento extensions
  • magerun - Run command line commands in Magento

All of the installed tools run in the working directory of the container, so don't forget to set it using the working_dir service configuration option in docker-compose.yml or the --workdir parameter to docker run.

Some of the commands use additional environment variables for configuration:

  • AWS_ACCESS_KEY_ID (magedbm, magemm) Credentials for S3 connections
  • AWS_SECRET_ACCESS_KEY (magedbm, magemm) Credentials for S3 connections
  • AWS_REGION (magedbm, magemm) S3 region to use
  • AWS_BUCKET (magedbm) S3 bucket to use for database backups
  • AWS_MEDIA_BUCKET (magemm) S3 bucket to fetch media images from

Building

A lot of the configuration for each image is the same, with the difference being the base image that they're extending from. For this reason we use php to build the Dockerfile from a set of templates in src/. The Dockerfile should still be published to the repository due to Docker Hub needing a Dockerfile to build from.

To build all Dockerfiles, run the builder.php script in the php:7 Docker image:

docker run --rm -it -v $(pwd):/src php:7 php /src/builder.php

Adding new images to the build config

The build configuration is controlled by the config.json file. Yeah element in the top level hash is a new build target, using the following syntax:

"<target-name>": {
    "version": "<php-version>",
    "flavour": "<image-flavour>",
    "files": {
        "<target-file-name>": {
            "<template-variable-name>": "<template-variable-value>",
            ...
        },
}

The target files will be rendered in the <php-version>/<image-flavour>/ directory.

The source template for each target file is selected from the src/ directory using the following fallback order:

  1. <target-file-name>-<php-version>-<image-flavour>
  2. <target-file-name>-<php-version>
  3. <target-file-name>-<image-flavour>
  4. <target-file-name>

Individual templates may include other templates as partials.

docker-magento's People

Contributors

adam-paterson avatar brideo avatar punkstar avatar tgerulaitis 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.