├── .dockerignore ├── .gitignore ├── .gitlab-ci.yml ├── DOCKER.md ├── Dockerfile ├── LICENSE ├── README.md ├── docker-compose.yml ├── entrypoint.sh ├── etc ├── apache.conf └── php.ini ├── example ├── .dockerignore ├── .gitignore ├── .gitlab-ci.yml ├── Dockerfile ├── Makefile ├── README.md ├── docker-compose.yml ├── docs │ ├── builds.md │ └── development.md └── src │ ├── .gitkeep │ ├── app │ └── etc │ │ ├── config.php │ │ └── env.php │ ├── composer.json │ └── cron ├── hooks └── .gitkeep └── src └── .gitkeep /.dockerignore: -------------------------------------------------------------------------------- 1 | var/cache/* 2 | var/tmp/* 3 | var/session/* 4 | var/log/* 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | src/* 3 | !src/.gitkeep 4 | test/ 5 | mysql/ 6 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | services: 2 | - docker:dind 3 | 4 | variables: 5 | DOCKER_DRIVER: overlay 6 | GIT_SUBMODULE_STRATEGY: recursive 7 | 8 | before_script: 9 | - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY 10 | - apk update 11 | - apk add bash wget curl git 12 | - apk add php7 php7-curl php7-openssl php7-json php7-phar php7-dom php7-iconv php7-mbstring php7-zlib 13 | - apk add php7-ctype php7-gd php7-simplexml php7-mcrypt php7-intl php7-xsl php7-zip php7-pdo_mysql 14 | - apk add php7-soap php7-xmlwriter php7-tokenizer php7-xml 15 | - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer 16 | - 'which ssh-agent || ( apk add openssh-client )' 17 | - eval $(ssh-agent -s) 18 | - bash -c 'ssh-add <(echo "$SSH_PRIVATE_KEY")' 19 | - mkdir -p ~/.ssh 20 | - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' 21 | - composer install 22 | 23 | stages: 24 | - build 25 | - release 26 | 27 | # Build version 28 | build-version: 29 | image: docker:latest 30 | stage: build 31 | variables: 32 | CONTAINER: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG 33 | only: 34 | - tags 35 | script: 36 | - docker build -t $CONTAINER . 37 | - docker push $CONTAINER 38 | 39 | # Build branch 40 | build-branch: 41 | image: docker:latest 42 | stage: build 43 | variables: 44 | CONTAINER: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME 45 | except: 46 | - tags 47 | - master 48 | script: 49 | - docker build -t $CONTAINER . 50 | - docker push $CONTAINER 51 | 52 | # Release when a version is set 53 | release-latest: 54 | image: docker:latest 55 | stage: release 56 | variables: 57 | CONTAINER: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG 58 | only: 59 | - tags 60 | script: 61 | - docker pull $CONTAINER 62 | - docker tag $CONTAINER $CI_REGISTRY_IMAGE:latest 63 | - docker push $CI_REGISTRY_IMAGE:latest 64 | -------------------------------------------------------------------------------- /DOCKER.md: -------------------------------------------------------------------------------- 1 | # Magento2 and Docker 2 | 3 | We recommend using Composer to manage the installation of Magento and its 4 | dependencies. Our container comes with Composer preinstalled but we don't 5 | run `composer install` or `composer update` in this image. Composer takes 6 | time. It would only delay the start of a new container. 7 | 8 | This image expects the full source, including plugins, to be added to the 9 | folder `/var/www/html`. You will have to prepare the source code yourself 10 | by running `composer install` on the CI-node or in your own development 11 | environment before adding it to this folder. 12 | 13 | Note: It does not care about how you build your source code. If Composer 14 | is not for you feel free to use a zip file or git to manage your source. 15 | 16 | # Building your own container 17 | 18 | This image is intended to serve as a base for your own container to build 19 | upon. You can create your own, private, git repository to handle all of 20 | your sources such as composer.json itself. 21 | 22 | A basic `Dockerfile` in your private git repository could look like: 23 | 24 | ``` 25 | FROM sensson/magento2 26 | COPY src/cron /etc/cron.d/magento2 27 | COPY src/ /var/www/html/ 28 | ``` 29 | 30 | Keep in mind that this container has two run types. It will either start 31 | a web server (Apache) or it will start the cron process. It never starts 32 | both. This behaviour can be managed through the `CRON` variable. Cron 33 | requires access to a similar source as the web application. 34 | 35 | # Installation and updates 36 | 37 | It can be dangerous to run automated installations or upgrades. We have 38 | included an `UNATTENDED` environment variable. It is unset by default but 39 | set it to `true` if you need to install or update Magento automatically. 40 | 41 | Leave this setting unset in production. If you need to run upgrades you 42 | could spin up a temporary container with `UNATTENDED` set to true. As it 43 | finishes you can upgrade all running containers with the latest version 44 | of your own image. 45 | 46 | Disclaimer: be very careful with updates. Don't expect everything to work 47 | and always use a temporary new branch to test your changes before merging 48 | them back into master. 49 | 50 | We do NOT create backups for you. 51 | 52 | # Cronjobs 53 | 54 | This image comes with cron support. Set `CRON` to true to have it start 55 | cron instead of the web server. We recommend a single service in your 56 | orchestration tool such as Kubernetes or Docker Swarm to run as cron. 57 | 58 | # Releases 59 | 60 | It doesn't matter what versioning scheme you use to mark your Docker images, 61 | but it is important to pick one. 2.2.1-1 could work, where -1 would be the 62 | release within the 2.2.1 branch, but others could work better depending on 63 | your use case. 64 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Base image is PHP 7.2 running Apache 2 | 3 | # FIX We want to build magento with PHP 7.2 4 | FROM php:7.2-apache 5 | 6 | LABEL company="Sensson" 7 | LABEL maintainer="info@sensson.net" 8 | 9 | # FIX We have to fix Mcrypt 10 | # FIX https://stackoverflow.com/questions/47671108/docker-php-ext-install-mcrypt-missing-folder 11 | RUN apt-get update && apt-get install -y libmcrypt-dev \ 12 | && pecl install mcrypt-1.0.2 \ 13 | && docker-php-ext-enable mcrypt 14 | 15 | # Install Magento 2 dependencies 16 | # FIX We have to change two package names 17 | # - libpng12-dev -> libpng-dev 18 | # - mysql-client -> default-mysql-client 19 | RUN apt-get update && apt-get install -y \ 20 | cron \ 21 | git \ 22 | libfreetype6-dev \ 23 | libjpeg62-turbo-dev \ 24 | libmcrypt-dev \ 25 | # FIX COMMENTED # libpng-dev \ 26 | libpng-dev \ 27 | libxml2-dev \ 28 | libxslt1-dev \ 29 | libicu-dev \ 30 | # FIX COMMENTED # mysql-client \ 31 | default-mysql-client \ 32 | xmlstarlet \ 33 | && docker-php-ext-install -j$(nproc) bcmath \ 34 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 35 | && docker-php-ext-install -j$(nproc) gd \ 36 | && docker-php-ext-install -j$(nproc) json \ 37 | && docker-php-ext-install -j$(nproc) iconv \ 38 | # FIX doker-php-ext can't install mcrypt since mcrypt has been pushed off the native extensions 39 | # FIX we managed this line 9 40 | # FIX COMMENTED # && docker-php-ext-install -j$(nproc) mcrypt \ 41 | && docker-php-ext-install -j$(nproc) mbstring \ 42 | && docker-php-ext-install -j$(nproc) pcntl \ 43 | && docker-php-ext-install -j$(nproc) soap \ 44 | && docker-php-ext-install -j$(nproc) xsl \ 45 | && docker-php-ext-install -j$(nproc) zip \ 46 | && docker-php-ext-install -j$(nproc) intl \ 47 | && docker-php-ext-install -j$(nproc) pdo \ 48 | && docker-php-ext-install -j$(nproc) pdo_mysql \ 49 | && docker-php-ext-install -j$(nproc) sockets \ 50 | && pecl install redis-5.0.2 \ 51 | && docker-php-ext-enable redis \ 52 | && a2enmod rewrite headers \ 53 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 54 | 55 | # Install composer 56 | RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ 57 | && php composer-setup.php --install-dir=/usr/local/bin/ --filename=composer \ 58 | && php -r "unlink('composer-setup.php');" 59 | 60 | # Install ioncube 61 | RUN cd /tmp \ 62 | && curl -o ioncube.tar.gz http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \ 63 | && tar -xvzf ioncube.tar.gz \ 64 | && mv ioncube/ioncube_loader_lin_7.2.so /usr/local/lib/php/extensions/* \ 65 | && rm -Rf ioncube.tar.gz ioncube \ 66 | && echo "zend_extension=ioncube_loader_lin_7.2.so" > /usr/local/etc/php/conf.d/00_docker-php-ext-ioncube_loader_lin_7.2.ini 67 | 68 | # Set up the application 69 | COPY src /var/www/html/ 70 | COPY entrypoint.sh /usr/local/bin/entrypoint.sh 71 | COPY etc/php.ini /usr/local/etc/php/conf.d/00_magento.ini 72 | COPY etc/apache.conf /etc/apache2/conf-enabled/00_magento.conf 73 | 74 | # Copy hooks 75 | COPY hooks /hooks/ 76 | 77 | # Set default parameters 78 | ENV MYSQL_HOSTNAME="mysql" MYSQL_USERNAME="root" MYSQL_PASSWORD="secure" MYSQL_DATABASE="magento" CRYPT_KEY="" \ 79 | URI="http://localhost" ADMIN_USERNAME="admin" ADMIN_PASSWORD="adm1nistrator" ADMIN_FIRSTNAME="admin" \ 80 | ADMIN_LASTNAME="admin" ADMIN_EMAIL="admin@localhost.com" CURRENCY="EUR" LANGUAGE="en_US" \ 81 | TIMEZONE="Europe/Amsterdam" BACKEND_FRONTNAME="admin" CONTENT_LANGUAGES="en_US" 82 | 83 | ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ] 84 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docker-magento2 2 | 3 | [![Docker Automated Build](https://img.shields.io/docker/automated/sensson/magento2.svg)](https://hub.docker.com/r/sensson/magento2/) [![Docker Build Status](https://img.shields.io/docker/build/sensson/magento2.svg)](https://hub.docker.com/r/sensson/magento2/) 4 | 5 | A base Magento 2 image that can be used to scale in production. This can 6 | be used in combination with MySQL and Redis. It is opinionated and includes 7 | support for Composer, ionCube, Redis, OPcache, and the required PHP modules 8 | for a basic Magento installation. 9 | 10 | It does not include Magento. 11 | 12 | # Usage 13 | 14 | An example `Dockerfile` 15 | 16 | ``` 17 | FROM sensson/magento2 18 | COPY src/ /var/www/html/ 19 | ``` 20 | 21 | More details can be found in [Magento2 and Docker](DOCKER.md). 22 | 23 | # Persistent storage 24 | 25 | The container assumes you do not store data in a folder along with the 26 | application. Don't use Docker volumes for scale. Use CephFS, GlusterFS or 27 | integrate with S3 or S3-compatible services such as [Fuga.io](https://fuga.io). 28 | 29 | # Configuration 30 | 31 | ## Environment variables 32 | 33 | Environment variable | Description | Default 34 | -------------------- | ----------- | ------- 35 | MYSQL_HOSTNAME | MySQL hostname | mysql 36 | MYSQL_USERNAME | MySQL username | root 37 | MYSQL_PASSWORD | MySQL password | secure 38 | MYSQL_DATABASE | MySQL database | magento 39 | CRYPTO_KEY | Magento Encryption key | Emtpy 40 | URI | Uri (e.g. http://localhost) | http://localhost 41 | RUNTYPE | Set to development to enable | Empty 42 | ADMIN_USERNAME | Administrator username | admin 43 | ADMIN_PASSWORD | Administrator password | adm1nistrator 44 | ADMIN_FIRSTNAME | Administrator first name | admin 45 | ADMIN_LASTNAME | Administrator last name | admin 46 | ADMIN_EMAIL | Administrator email address | admin@localhost.com 47 | BACKEND_FRONTNAME | The URI of the admin panel | admin 48 | CURRENCY | Magento's default currency | EUR 49 | LANGUAGE | Magento's default language | en_US 50 | CONTENT_LANGUAGES | The languages used in Magento | en_US 51 | TIMEZONE | Magento's timezone | Europe/Amsterdam 52 | CRON | Run as a cron container | false 53 | UNATTENDED | Run unattended upgrades | false 54 | 55 | Include the port mapping in `URI` if you run your shop on a local development 56 | environment, e.g. `http://localhost:3000/`. 57 | 58 | ## Hooks 59 | 60 | Hooks allow you to run certain actions at certain points in the startup 61 | procedure without having to rewrite `entrypoint.sh`. You can use hooks to 62 | import data, preconfigure settings or run other scripts that need to run 63 | each startup sequence. 64 | 65 | Hook point | Location | Description 66 | ---------- | --------- | ----------- 67 | Pre install | `/hooks/pre_install.sh` | Runs before an installation or update. 68 | Pre compile | `/hooks/pre_compile.sh` | Runs before code compilation starts. 69 | Post install | `/hooks/post_install.sh` | Runs after Magento has been installed. 70 | 71 | You need to `COPY` any hooks to this location yourself. 72 | 73 | ## Development mode 74 | 75 | Setting `RUNTYPE` to `development` will turn on public error reports. Anything 76 | else will leave it off. It will also set `display_errors` to on in PHP. This is 77 | set to off by default. 78 | 79 | A basic `docker-compose.yml` has been provided to help during the development 80 | of this image. 81 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | frontend: 5 | build: . 6 | image: sensson/magento2 7 | restart: always 8 | depends_on: 9 | - mysql 10 | links: 11 | - mysql 12 | ports: 13 | - "8000:80" 14 | environment: 15 | - RUNTYPE=development 16 | - MYSQL_HOSTNAME=mysql 17 | - MYSQL_USERNAME=root 18 | - MYSQL_PASSWORD=password 19 | - MYSQL_DATABASE=magento 20 | - CRYPTO_KEY=secured 21 | - URI=http://localhost:8000 22 | - BACKEND_FRONTNAME=admin 23 | - UNATTENDED=true 24 | networks: 25 | - backend 26 | 27 | mysql: 28 | image: mysql:5 29 | restart: always 30 | volumes: 31 | - ./mysql:/var/lib/mysql 32 | environment: 33 | - MYSQL_ROOT_PASSWORD=password 34 | - MYSQL_DATABASE=magento 35 | networks: 36 | - backend 37 | 38 | networks: 39 | backend: 40 | driver: bridge 41 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Our entrypoint manages both new as existing Magento2 installations. 3 | # 4 | # Apache License 2.0 5 | # Copyright (c) 2017 Sensson and contributors 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | set -eo pipefail 14 | COMMAND="$@" 15 | 16 | # Set hooks 17 | PRE_INSTALL_HOOK="/hooks/pre_install.sh" 18 | PRE_COMPILE_HOOK="/hooks/pre_compile.sh" 19 | POST_INSTALL_HOOK="/hooks/post_install.sh" 20 | 21 | # Override the default command 22 | if [ -n "${COMMAND}" ]; then 23 | echo "ENTRYPOINT: Executing override command" 24 | exec $COMMAND 25 | else 26 | # Check if we can connect to the database 27 | while ! mysqladmin ping -h"${MYSQL_HOSTNAME}" --silent; do 28 | echo "Waiting on database connection.." 29 | sleep 2 30 | done 31 | 32 | # Measure the time it takes to bootstrap the container 33 | START=`date +%s` 34 | 35 | # Set the base Magento command to bin/magento 36 | CMD_MAGENTO="bin/magento" && chmod +x $CMD_MAGENTO 37 | 38 | # Set the config command 39 | CMD_CONFIG="${CMD_MAGENTO} setup:config:set --db-host="${MYSQL_HOSTNAME}" \ 40 | --db-name="${MYSQL_DATABASE}" --db-user="${MYSQL_USERNAME}" \ 41 | --db-password="${MYSQL_PASSWORD}" --key="${CRYPTO_KEY}" --no-interaction" 42 | 43 | # Set up the backend frontname -- it's recommended to not use 'backend' or 44 | # 'admin' here 45 | if [[ -n "${BACKEND_FRONTNAME}" ]]; then 46 | CMD_CONFIG="${CMD_CONFIG} --backend-frontname=${BACKEND_FRONTNAME}" 47 | fi 48 | 49 | # Set the install command 50 | CMD_INSTALL="${CMD_MAGENTO} setup:install --base-url="${URI}" \ 51 | --admin-firstname="${ADMIN_FIRSTNAME}" \ 52 | --admin-lastname="${ADMIN_LASTNAME}" \ 53 | --admin-email="${ADMIN_EMAIL}" \ 54 | --admin-user="${ADMIN_USERNAME}" \ 55 | --admin-password="${ADMIN_PASSWORD}" --language="${LANGUAGE}" \ 56 | --currency="${CURRENCY}" --timezone="${TIMEZONE}" \ 57 | --use-rewrites=1" 58 | 59 | # Run configuration command 60 | $CMD_CONFIG 61 | 62 | # Run any commands that need to run before code compilation starts 63 | if [ -f "${PRE_INSTALL_HOOK}" ]; then 64 | echo "HOOKS: Running PRE_INSTALL_HOOK" 65 | chmod +x "${PRE_INSTALL_HOOK}" 66 | $PRE_INSTALL_HOOK 67 | fi 68 | 69 | # Run setup:db:status to get an idea about the current state 70 | CHECK_STATUS=$($CMD_MAGENTO setup:db:status 2>&1 || true) 71 | 72 | # Automated installs and updates can be tricky if they are not handled 73 | # properly. This could for example run updates twice if you're updating 74 | # a deployment in Kubernetes or service in Docker Swarm. There are very 75 | # sane reasons NOT to run automated installations or updates. 76 | if [ "${UNATTENDED}" == "true" ]; then 77 | if [[ $CHECK_STATUS == *"up to date"*. ]]; then 78 | echo "Installation is up to date" 79 | elif [[ $CHECK_STATUS == *"Magento application is not installed"*. ]]; then 80 | echo "Running installer.." 81 | $CMD_INSTALL 82 | else 83 | CHECK_PLUGINS=$((echo $CHECK_STATUS | grep -o '\' || true) | \ 84 | wc -l) 85 | 86 | if [[ "${CHECK_PLUGINS}" -eq "0" ]]; then 87 | UNINSTALLED_PLUGINS=0 88 | echo "Update required." 89 | else 90 | UNINSTALLED_PLUGINS=$(expr $CHECK_PLUGINS / 2) 91 | echo "Found ${UNINSTALLED_PLUGINS} uninstalled plugin(s)." 92 | fi 93 | 94 | # This is an arbitrary number. As we're checking on 'none' as an 95 | # individual word this should be able to handle minor upgrades of 96 | # Magento (2.1 > 2.2) 97 | if [[ $UNINSTALLED_PLUGINS -gt 20 ]]; then 98 | echo "Running installer.." 99 | $CMD_INSTALL 100 | else 101 | echo "Running upgrade.." 102 | $CMD_MAGENTO setup:upgrade 103 | fi 104 | fi 105 | fi 106 | 107 | # Run any commands that need to run before code compilation starts 108 | if [ -f "${PRE_COMPILE_HOOK}" ]; then 109 | echo "HOOKS: Running PRE_COMPILE_HOOK" 110 | chmod +x "${PRE_COMPILE_HOOK}" 111 | $PRE_COMPILE_HOOK 112 | fi 113 | 114 | # Run code compilation 115 | $CMD_MAGENTO setup:di:compile 116 | 117 | # Empty line 118 | echo 119 | 120 | # Check RUNTYPE and decide if we run in production or development 121 | if [ "$RUNTYPE" == "development" ]; then 122 | # DEVELOPMENT 123 | echo "Switching to development mode" 124 | $CMD_MAGENTO deploy:mode:set developer -s 125 | 126 | # Change config files 127 | sed -i "s/SetEnv MAGE_MODE.*/SetEnv MAGE_MODE \"developer\"/" \ 128 | /etc/apache2/conf-enabled/00_magento.conf 129 | sed -i "s/opcache.enable=.*/opcache.enable=0/" \ 130 | /usr/local/etc/php/conf.d/00_magento.ini 131 | 132 | # Enable error reporting 133 | echo 'display_errors = On' >> /usr/local/etc/php/conf.d/00_production.ini 134 | else 135 | # PRODUCTION 136 | echo "Switching to production mode" 137 | $CMD_MAGENTO deploy:mode:set production -s 138 | 139 | # Change config files 140 | sed -i "s/SetEnv MAGE_MODE.*/SetEnv MAGE_MODE \"production\"/" \ 141 | /etc/apache2/conf-enabled/00_magento.conf 142 | sed -i "s/opcache.enable=.*/opcache.enable=1/" \ 143 | /usr/local/etc/php/conf.d/00_magento.ini 144 | 145 | # Disable error reporting 146 | echo 'display_errors = Off' >> /usr/local/etc/php/conf.d/00_production.ini 147 | 148 | # Deploy static content 149 | $CMD_MAGENTO setup:static-content:deploy $CONTENT_LANGUAGES 150 | fi 151 | 152 | echo "Changing permissions to www-data.. " 153 | chown -R www-data: /var/www/html 154 | 155 | # Calculate the number of seconds required to bootstrap the container 156 | END=`date +%s` 157 | RUNTIME=$((END-START)) 158 | echo "Startup preparation finished in ${RUNTIME} seconds" 159 | 160 | # Run any post install hooks (e.g. run a database script). You can't interact 161 | # with the Magento API at this point as you need a running webserver. 162 | if [ -f "${POST_INSTALL_HOOK}" ]; then 163 | echo "HOOKS: Running POST_INSTALL_HOOK" 164 | chmod +x "${POST_INSTALL_HOOK}" 165 | $POST_INSTALL_HOOK 166 | fi 167 | 168 | # If CRON is set to true we only start cron in this container. We needed to 169 | # go through the same process as Apache to match all requirements. 170 | if [ "${CRON}" == "true" ]; then 171 | echo "CRON: Starting crontab" 172 | 173 | # Make sure all files have the correct permissions and start cron 174 | find /etc/cron* -type f -exec chmod 0644 {} \; 175 | exec cron -f 176 | else 177 | echo "APACHE: Starting webserver" 178 | exec /usr/local/bin/apache2-foreground 179 | fi 180 | fi 181 | -------------------------------------------------------------------------------- /etc/apache.conf: -------------------------------------------------------------------------------- 1 | # Enable support for SSL termination 2 | SetEnvIf X-Forwarded-Proto https HTTPS=on 3 | SetEnv MAGE_MODE production 4 | -------------------------------------------------------------------------------- /etc/php.ini: -------------------------------------------------------------------------------- 1 | ; Set the default time zone to silence warnings 2 | date.timezone=Europe/Amsterdam 3 | 4 | ; Magento recommended settings 5 | memory_limit=2G 6 | max_execution_time = 600 7 | upload_max_filesize=256M 8 | post_max_size=256M 9 | 10 | ; Opcache settings for Magento 11 | zend_extension=opcache.so 12 | opcache.enable=1 13 | opcache.memory_consumption=256 14 | opcache.interned_strings_buffer=12 15 | opcache.max_accelerated_files=16000 16 | opcache.validate_timestamps=0 17 | opcache.save_comments=1 18 | opcache.load_comments=0 19 | opcache.fast_shutdown=1 20 | opcache.enable_file_override=1 21 | opcache.blacklist_filename=/var/www/html/opcache*.blacklist 22 | opcache.error_log= 23 | opcache.log_verbosity_level=1 24 | -------------------------------------------------------------------------------- /example/.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | src/* 3 | !src/.gitkeep 4 | !src/cron 5 | !src/composer.json 6 | !src/app/etc/env.php 7 | !src/app/etc/config.php 8 | mysql 9 | -------------------------------------------------------------------------------- /example/.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # .gitlab-ci.yml 2 | # 3 | # This is used to test, build and release our infrastructure to both 4 | # acceptance (running the develop branch) and production (running the 5 | # release tagged with a version number). 6 | # 7 | # You MUST configure it by changing the variables settings below and we 8 | # recommend going through the entire file to understand what happens and 9 | # how it can affect your build and deployments. 10 | # 11 | # Apache License 2.0 12 | # Copyright (c) 2018 Sensson and contributors 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | # See the License for the specific language governing permissions and 18 | # limitations under the License. 19 | services: 20 | - docker:dind 21 | 22 | # Set the CONTAINER variable to the same variable as what is set as image in 23 | # name docker-compose.yml. CI will fail otherwise. 24 | variables: 25 | DOCKER_DRIVER: overlay 26 | DOCKER_SWARM_MASTER: tcp://172.16.1.1:2376 27 | GIT_SUBMODULE_STRATEGY: recursive 28 | CONTAINER: $CI_REGISTRY_IMAGE:latest 29 | 30 | # This tests the integration of our image into an environment running MySQL 31 | # and Magento. As the initial deployment takes time we wait for a maximum of 32 | # four minutes to deploy after which we consider the test to have failed. 33 | # 34 | # As soon as more tests are required it's recommended to switch from individual 35 | # `docker run`-commands to a test suite written in bash. 36 | .integration: &integration | 37 | docker-compose build 38 | docker-compose up -d 39 | echo "Waiting on the environment to come online" 40 | sleep 240 41 | docker logs magento-frontend || true 42 | docker run --rm --net host appropriate/curl -I -s localhost:8080 | \ 43 | grep '200 OK' 44 | docker-compose down 45 | 46 | # Deployment does not create new deployments for you. It will only update 47 | # existing ones. Feel free to adjust as required. 48 | .deployment: &deployment | 49 | docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY 50 | export DOCKER_TLS_VERIFY="1" 51 | export DOCKER_HOST="$DOCKER_SWARM_MASTER" 52 | export DOCKER_CERT_PATH="certs" 53 | mkdir $DOCKER_CERT_PATH 54 | echo "$DOCKER_MACHINE_CA" > $DOCKER_CERT_PATH/ca.pem 55 | echo "$DOCKER_MACHINE_CLIENT_CERT" > $DOCKER_CERT_PATH/cert.pem 56 | echo "$DOCKER_MACHINE_CLIENT_KEY" > $DOCKER_CERT_PATH/key.pem 57 | docker service update --with-registry-auth --image $RELEASE $SERVICE_FRONTEND 58 | docker service update --with-registry-auth --image $RELEASE $SERVICE_CRON 59 | rm -rf $DOCKER_CERT_PATH 60 | 61 | # Setup all requirements for Magento 2 before we run `make source`. 62 | before_script: 63 | - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY 64 | - apk update 65 | - apk add bash wget curl git make py-pip 66 | - apk add php7 php7-curl php7-openssl php7-json php7-phar php7-dom php7-iconv 67 | - apk add php7-mbstring php7-zlib php7-ctype php7-gd php7-simplexml 68 | - apk add php7-mcrypt php7-intl php7-xsl php7-zip php7-pdo_mysql php7-soap 69 | - apk add php7-xmlwriter php7-tokenizer php7-xml php7-bcmath 70 | - pip install docker-compose 71 | - curl -sS https://getcomposer.org/installer | php -- 72 | --install-dir=/usr/bin --filename=composer 73 | - 'which ssh-agent || ( apk add openssh-client )' 74 | - eval $(ssh-agent -s) 75 | - bash -c 'ssh-add <(echo "$SSH_PRIVATE_KEY")' 76 | - mkdir -p ~/.ssh 77 | - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" 78 | > ~/.ssh/config' 79 | - composer config -a -g http-basic.repo.magento.com 80 | $COMPOSER_REPO_MAGENTO_COM_USERNAME $COMPOSER_REPO_MAGENTO_COM_PASSWORD 81 | - make source 82 | 83 | stages: 84 | - build 85 | - deploy 86 | 87 | # Run integration tests on every branch but don't push the image 88 | build-branch: 89 | image: docker:latest 90 | stage: build 91 | except: 92 | - develop 93 | - tags 94 | - master 95 | script: 96 | - *integration 97 | 98 | # Build an image for our development branch 99 | build-develop: 100 | image: docker:latest 101 | stage: build 102 | only: 103 | - develop 104 | script: 105 | - *integration 106 | - docker push $CONTAINER 107 | 108 | # Build an image for our releases 109 | build-release: 110 | image: docker:latest 111 | stage: build 112 | variables: 113 | RELEASE: $CONTAINER 114 | SERVICE_CRON: core-prod-cron 115 | SERVICE_FRONTEND: core-prod-frontend 116 | only: 117 | - tags 118 | script: 119 | - *integration 120 | - docker tag $CONTAINER $CI_REGISTRY_IMAGE:latest 121 | - docker tag $CONTAINER $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG 122 | - docker push $CI_REGISTRY_IMAGE:latest 123 | - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG 124 | 125 | # The deploy stage is split into a separate stage on purpose. If for any 126 | # reason we need to redeploy a development or production environment this 127 | # ensures that we only go through this particular step instead of building 128 | # a new image. For this we override before_script as that would only slow 129 | # down the deployment. 130 | deploy-develop: 131 | image: docker:latest 132 | stage: deploy 133 | variables: 134 | RELEASE: $CI_REGISTRY_IMAGE:develop 135 | SERVICE_CRON: test-yourwebsite-cron 136 | SERVICE_FRONTEND: test-yourwebsite-com 137 | before_script: 138 | - echo 'Skipping integration and build process' 139 | environment: 140 | name: test 141 | url: https://test.yourwebsite.com/ 142 | only: 143 | - develop 144 | script: 145 | - *deployment 146 | 147 | deploy-release: 148 | image: docker:latest 149 | stage: deploy 150 | variables: 151 | RELEASE: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG 152 | SERVICE_CRON: prod-yourwebsite-cron 153 | SERVICE_FRONTEND: prod-yourwebsite-com 154 | before_script: 155 | - echo 'Skipping integration and build process' 156 | environment: 157 | name: production 158 | url: https://www.yourwebsite.com 159 | only: 160 | - tags 161 | script: 162 | - *deployment 163 | -------------------------------------------------------------------------------- /example/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM sensson/magento2 2 | COPY src/cron /etc/cron.d/magento2 3 | COPY src/ /var/www/html/ 4 | -------------------------------------------------------------------------------- /example/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: help 2 | 3 | help: ## This help text 4 | @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) 5 | 6 | .DEFAULT_GOAL := help 7 | 8 | source: ## Create a new development environment 9 | cd src && rm -f composer.lock && composer install --no-progress 10 | 11 | env: ## Setup a test environment 12 | docker-compose build 13 | docker-compose up 14 | 15 | clean: ## Clean up 16 | docker-compose down 17 | find src -maxdepth 1 -type d ! -name 'src' ! -name 'app' -exec rm -rf {} \; 18 | find src -type f ! -name '.gitkeep' ! -name 'cron' ! -name 'composer.json' ! -name 'config.php' ! -name 'env.php' -exec rm -f {} \; 19 | rm -rf src/app/design/ 20 | rm -rf mysql/* 21 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # Magento 2 2 | 3 | This is a working example of how you could implement `sensson/magento2`. 4 | 5 | Although we have carefully crafted this example it may contain bugs, security 6 | issues or other problems that we were not aware of at the time. 7 | 8 | Please take extreme care when building your own environment based on this 9 | example and understand what each and every file does first before you use 10 | this in production. 11 | 12 | Feedback, issues or pull requests are always appreciated. 13 | -------------------------------------------------------------------------------- /example/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | mysql: 5 | image: mysql:5.7 6 | container_name: mysql 7 | restart: always 8 | volumes: 9 | - ./mysql:/var/lib/mysql 10 | environment: 11 | - MYSQL_ROOT_PASSWORD=bS3vF3TQLXphcGxk 12 | - MYSQL_DATABASE=magento 13 | networks: 14 | - backend 15 | 16 | frontend: 17 | # build has been left out on purpose. The steps to build a container 18 | # are not covered in the Dockerfile, they have been left out on purpose 19 | # so all preparation is done in an intermediate environment that has 20 | # all requirements. See .gitlab-ci.yml. 21 | build: . 22 | image: magento2:latest 23 | container_name: magento-frontend 24 | links: 25 | - mysql:mysql 26 | restart: always 27 | environment: 28 | - MYSQL_HOSTNAME=mysql 29 | - MYSQL_USERNAME=root 30 | - MYSQL_PASSWORD=bS3vF3TQLXphcGxk 31 | - MYSQL_DATABASE=magento 32 | - CRYPTO_KEY=SxKT2RyykbmbhDmh 33 | - URI=http://localhost:8080 34 | - RUNTYPE=development 35 | - ADMIN_USERNAME=admin 36 | - ADMIN_PASSWORD=adm1nistr4tor 37 | - ADMIN_FIRSTNAME=Your 38 | - ADMIN_LASTNAME=Name 39 | - ADMIN_EMAIL=you@yourwebsite.com 40 | - UNATTENDED=true 41 | ports: 42 | - 8080:80 43 | networks: 44 | - backend 45 | 46 | cron: 47 | # There is no need to build an image twice. We can reuse the image that 48 | # was build as a frontend 49 | image: magento2:latest 50 | container_name: magento-cron 51 | depends_on: 52 | - frontend 53 | links: 54 | - mysql:mysql 55 | restart: always 56 | environment: 57 | - MYSQL_HOSTNAME=mysql 58 | - MYSQL_USERNAME=root 59 | - MYSQL_PASSWORD=bS3vF3TQLXphcGxk 60 | - MYSQL_DATABASE=magento 61 | - CRYPTO_KEY=SxKT2RyykbmbhDmh 62 | - URI=http://localhost:8080 63 | - RUNTYPE=development 64 | - ADMIN_USERNAME=admin 65 | - ADMIN_PASSWORD=adm1nistr4tor 66 | - ADMIN_FIRSTNAME=Your 67 | - ADMIN_LASTNAME=Name 68 | - ADMIN_EMAIL=you@yourwebsite.com 69 | - CRON=true 70 | networks: 71 | - backend 72 | 73 | networks: 74 | backend: 75 | driver: bridge 76 | -------------------------------------------------------------------------------- /example/docs/builds.md: -------------------------------------------------------------------------------- 1 | # Builds 2 | 3 | Note that our builds are not intended to deploy new services. They will only 4 | redeploy existing services. The build process runs on CI-servers and requires 5 | the following environment variables to be set. 6 | 7 | Environment variable | Description 8 | -------------------- | ----------- 9 | SSH_PRIVATE_KEY | A private key with access to custom repositories 10 | COMPOSER_REPO_MAGENTO_COM_USERNAME | The public key for Magento 2 11 | COMPOSER_REPO_MAGENTO_COM_PASSWORD | The private key for Magento 2 12 | DOCKER_MACHINE_CA | Docker Machine CA 13 | DOCKER_MACHINE_CLIENT_CERT | Docker Machine client certificate 14 | DOCKER_MACHINE_CLIENT_KEY | Docker Machine client key 15 | 16 | https://github.com/XIThing/generate-docker-client-certs/ explains how to 17 | generate the DOCKER_MACHINE-certificates. 18 | -------------------------------------------------------------------------------- /example/docs/development.md: -------------------------------------------------------------------------------- 1 | # Development 2 | 3 | ## Prerequisites 4 | 5 | You need to be running MacOS or Linux with Docker installed. 6 | 7 | * Docker 8 | * composer 9 | * [Magento 2 technology stack requirements](http://devdocs.magento.com/guides/v2.0/install-gde/system-requirements-tech.html) 10 | * Access to repo.magento.com 11 | 12 | ## Setting up a local development environment 13 | 14 | * `make source`. This will install the Magento 2 source and run composer install. 15 | * `make env`. This will setup a Docker Compose environment. 16 | * `make clean`. This will clean all data and stop any Docker Compose environments. 17 | -------------------------------------------------------------------------------- /example/src/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensson/docker-magento2/b4e469b29eaaec0e7f8927e9aeef9e30ea8a506b/example/src/.gitkeep -------------------------------------------------------------------------------- /example/src/app/etc/config.php: -------------------------------------------------------------------------------- 1 | 4 | array ( 5 | 'Magento_Store' => 1, 6 | 'Magento_Directory' => 1, 7 | 'Magento_Backend' => 1, 8 | 'Magento_Eav' => 1, 9 | 'Magento_Theme' => 1, 10 | 'Magento_AdvancedPricingImportExport' => 1, 11 | 'Magento_Authorization' => 1, 12 | 'Magento_Customer' => 1, 13 | 'Magento_AdminNotification' => 1, 14 | 'Magento_Backup' => 1, 15 | 'Magento_Indexer' => 1, 16 | 'Magento_Cms' => 1, 17 | 'Magento_BundleImportExport' => 1, 18 | 'Magento_CacheInvalidate' => 1, 19 | 'Magento_Catalog' => 1, 20 | 'Magento_Wishlist' => 1, 21 | 'Magento_CatalogImportExport' => 1, 22 | 'Magento_Payment' => 1, 23 | 'Magento_Rule' => 1, 24 | 'Magento_Msrp' => 1, 25 | 'Magento_Search' => 1, 26 | 'Magento_CatalogUrlRewrite' => 1, 27 | 'Magento_Widget' => 1, 28 | 'Magento_Quote' => 1, 29 | 'Magento_SalesSequence' => 1, 30 | 'Magento_Sales' => 1, 31 | 'Magento_CmsUrlRewrite' => 1, 32 | 'Magento_Config' => 1, 33 | 'Magento_ConfigurableImportExport' => 1, 34 | 'Magento_CatalogInventory' => 1, 35 | 'Magento_Checkout' => 1, 36 | 'Magento_Contact' => 1, 37 | 'Magento_Cookie' => 1, 38 | 'Magento_Cron' => 1, 39 | 'Magento_CurrencySymbol' => 1, 40 | 'Magento_CustomerImportExport' => 1, 41 | 'Magento_Deploy' => 1, 42 | 'Magento_Developer' => 1, 43 | 'Magento_Dhl' => 1, 44 | 'Magento_Captcha' => 1, 45 | 'Magento_Downloadable' => 1, 46 | 'Magento_ImportExport' => 1, 47 | 'Magento_Ui' => 1, 48 | 'Magento_Email' => 1, 49 | 'Magento_User' => 1, 50 | 'Magento_Fedex' => 1, 51 | 'Magento_GiftMessage' => 1, 52 | 'Magento_GoogleAdwords' => 1, 53 | 'Magento_GoogleAnalytics' => 1, 54 | 'Magento_GoogleOptimizer' => 1, 55 | 'Magento_GroupedImportExport' => 1, 56 | 'Magento_GroupedProduct' => 1, 57 | 'Magento_DownloadableImportExport' => 1, 58 | 'Magento_Authorizenet' => 1, 59 | 'Magento_Security' => 1, 60 | 'Magento_LayeredNavigation' => 1, 61 | 'Magento_Marketplace' => 1, 62 | 'Magento_MediaStorage' => 1, 63 | 'Magento_CatalogRule' => 1, 64 | 'Magento_Multishipping' => 1, 65 | 'Magento_ConfigurableProduct' => 1, 66 | 'Magento_Newsletter' => 1, 67 | 'Magento_OfflinePayments' => 1, 68 | 'Magento_SalesRule' => 1, 69 | 'Magento_PageCache' => 1, 70 | 'Magento_Vault' => 1, 71 | 'Magento_Paypal' => 1, 72 | 'Magento_Persistent' => 1, 73 | 'Magento_ProductAlert' => 1, 74 | 'Magento_ProductVideo' => 1, 75 | 'Magento_CheckoutAgreements' => 1, 76 | 'Magento_Reports' => 1, 77 | 'Magento_RequireJs' => 1, 78 | 'Magento_Review' => 1, 79 | 'Magento_Robots' => 1, 80 | 'Magento_Rss' => 1, 81 | 'Magento_CatalogRuleConfigurable' => 1, 82 | 'Magento_ConfigurableProductSales' => 1, 83 | 'Magento_SalesInventory' => 1, 84 | 'Magento_OfflineShipping' => 1, 85 | 'Magento_Shipping' => 1, 86 | 'Magento_UrlRewrite' => 1, 87 | 'Magento_CatalogSearch' => 1, 88 | 'Magento_Integration' => 1, 89 | 'Magento_SendFriend' => 1, 90 | 'Magento_Signifyd' => 1, 91 | 'Magento_Sitemap' => 1, 92 | 'Magento_Bundle' => 1, 93 | 'Magento_Swagger' => 1, 94 | 'Magento_Swatches' => 1, 95 | 'Magento_SwatchesLayeredNavigation' => 1, 96 | 'Magento_Tax' => 1, 97 | 'Magento_TaxImportExport' => 1, 98 | 'Magento_NewRelicReporting' => 1, 99 | 'Magento_Translation' => 1, 100 | 'Magento_Ups' => 1, 101 | 'Magento_SampleData' => 1, 102 | 'Magento_EncryptionKey' => 1, 103 | 'Magento_Usps' => 1, 104 | 'Magento_Variable' => 1, 105 | 'Magento_Braintree' => 1, 106 | 'Magento_Version' => 1, 107 | 'Magento_Webapi' => 1, 108 | 'Magento_WebapiSecurity' => 1, 109 | 'Magento_Weee' => 1, 110 | 'Magento_CatalogWidget' => 1, 111 | ), 112 | ); 113 | -------------------------------------------------------------------------------- /example/src/app/etc/env.php: -------------------------------------------------------------------------------- 1 | array('date' => 'Mon, 22 Jan 2018 20:00:00 +0000',), 4 | 5 | // Set default caching 6 | 'cache_types' => array( 7 | 'config' => 1, 8 | 'layout' => 1, 9 | 'block_html' => 1, 10 | 'collections' => 1, 11 | 'reflection' => 1, 12 | 'db_ddl' => 1, 13 | 'eav' => 1, 14 | 'customer_notification' => 1, 15 | 'full_page' => 1, 16 | 'config_integration' => 1, 17 | 'config_integration_api' => 1, 18 | 'translate' => 1, 19 | 'config_webservice' => 1, 20 | ), 21 | ); 22 | -------------------------------------------------------------------------------- /example/src/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magento/project-community-edition", 3 | "description": "eCommerce Platform for Growth (Community Edition)", 4 | "type": "project", 5 | "version": "2.2.10", 6 | "license": [ 7 | "OSL-3.0", 8 | "AFL-3.0" 9 | ], 10 | "config": { 11 | "platform": { 12 | "php": "7.2.22" 13 | } 14 | }, 15 | "require": { 16 | "magento/product-community-edition": "2.2.10", 17 | "composer/composer": "@alpha" 18 | }, 19 | "require-dev": { 20 | "phpunit/phpunit": "~6.2.0", 21 | "squizlabs/php_codesniffer": "3.1.1", 22 | "phpmd/phpmd": "@stable", 23 | "pdepend/pdepend": "2.5.0", 24 | "friendsofphp/php-cs-fixer": "~2.2.0", 25 | "lusitanian/oauth": "~0.8.10", 26 | "sebastian/phpcpd": "2.0.4" 27 | }, 28 | "autoload": { 29 | "psr-4": { 30 | "Magento\\Framework\\": "lib/internal/Magento/Framework/", 31 | "Magento\\Setup\\": "setup/src/Magento/Setup/", 32 | "Magento\\": "app/code/Magento/" 33 | }, 34 | "psr-0": { 35 | "": [ 36 | "app/code/" 37 | ] 38 | }, 39 | "files": [ 40 | "app/etc/NonComposerComponentRegistration.php" 41 | ], 42 | "exclude-from-classmap": [ 43 | "**/dev/**", 44 | "**/update/**", 45 | "**/Test/**" 46 | ] 47 | }, 48 | "autoload-dev": { 49 | "psr-4": { 50 | "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/", 51 | "Magento\\Tools\\": "dev/tools/Magento/Tools/", 52 | "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/", 53 | "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/", 54 | "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/" 55 | } 56 | }, 57 | "minimum-stability": "stable", 58 | "repositories": [ 59 | { 60 | "type": "composer", 61 | "url": "https://repo.magento.com/" 62 | } 63 | ], 64 | "extra": { 65 | "magento-force": "override" 66 | }, 67 | "replace": { 68 | "temando/module-shipping-m2": "*" 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /example/src/cron: -------------------------------------------------------------------------------- 1 | * * * * * root /usr/local/bin/php /var/www/html/bin/magento cron:run > /proc/1/fd/1 2> /proc/1/fd/2 2 | -------------------------------------------------------------------------------- /hooks/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensson/docker-magento2/b4e469b29eaaec0e7f8927e9aeef9e30ea8a506b/hooks/.gitkeep -------------------------------------------------------------------------------- /src/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensson/docker-magento2/b4e469b29eaaec0e7f8927e9aeef9e30ea8a506b/src/.gitkeep --------------------------------------------------------------------------------