├── .gitignore ├── Changelog.md ├── Readme.md ├── docker-images-build-multiplatform.sh ├── docker-images-build.sh ├── docker-images-push.sh ├── local_infrastructure ├── configuration │ ├── certificates.toml.dist │ └── routes.toml ├── docker-compose.yml ├── migration │ ├── migrate_1.x-2.0.sh │ └── update-2.0.sh ├── my.cnf └── traefik.toml └── templates └── php ├── 5.6 ├── development.Dockerfile └── production.Dockerfile ├── 7.0 ├── development.Dockerfile └── production.Dockerfile ├── 7.1 ├── development.Dockerfile └── production.Dockerfile ├── 7.2 ├── development.Dockerfile └── production.Dockerfile ├── 7.3 ├── development.Dockerfile └── production.Dockerfile ├── 7.4 ├── development.Dockerfile └── production.Dockerfile ├── 8.0 ├── development.Dockerfile └── production.Dockerfile ├── 8.1 ├── development.Dockerfile └── production.Dockerfile ├── 8.2 ├── development.Dockerfile └── production.Dockerfile └── 8.3 ├── development.Dockerfile └── production.Dockerfile /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea/* 3 | /local_infrastructure/configuration/certificates.toml -------------------------------------------------------------------------------- /Changelog.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 | 8 | # [2.4.0] - 2023.12.25 9 | 10 | ### Added 11 | 12 | - New PHP 8.3 images 13 | - Multiplatform build script `docker-images-build-multiplatform.sh`. 14 | 15 | ### Changed 16 | 17 | - Image update policy: new versions or fixes will always have a new tag. Old tags will not be updated. 18 | - Image tags now contain the full PHP version (e.g. `8.3.6-development` instead of `8.3-development`) for explicit versioning. 19 | 20 | 21 | # [2.3.0] - 2023.06.22 22 | 23 | ### Added 24 | 25 | - Added digest (sha256) to PHP images 26 | 27 | ### Changed 28 | 29 | - Changed commands delimiter from `;` to `&&` 30 | - Now all development Dockerfiles are based on the production ones 31 | 32 | ### Removed 33 | 34 | - Removed the external `composer-proxy` script 35 | 36 | 37 | ## [2.2.4] - 2023.06.16 38 | 39 | ### Changed 40 | 41 | - Readme update after the Dockerizer 3.2.0 release. Removed all information about using this repository as a part of the development environment. 42 | 43 | 44 | ## [2.2.3] - 2023.03.20 45 | 46 | ### Deprecated 47 | 48 | - Deprecated the entire projects. In the nearest future, it will only keep the PHP Dockerfiles. Everything related to the `local_infrastructure` is not supported anymore, and soon will be removed. 49 | 50 | 51 | ### Removed 52 | 53 | - Dockerizer 1/2 project templates 54 | 55 | 56 | ## [2.2.2] - 2022.09.02 57 | 58 | ### Changed 59 | 60 | - PHP `memory_limit` set to `2048M` for 7.4-8.1. Composer is always run with `php -d memory_limit=4096M ` (see `./docker/composer-proxy`) 61 | 62 | 63 | ## [2.2.1] - 2022.05.03 64 | 65 | Preparing to Dockerizer v3 release. 66 | 67 | ### Changed 68 | 69 | - Run `apt upgrade` before installing packages to have latest and more secure environment. 70 | - Changed network mode to `host`, removed port mappings. 71 | 72 | ### Removed 73 | 74 | - Livereload configuration on ports `35729` and `35730`. Use this simple [Live Reload](https://chrome.google.com/webstore/detail/live-reload/jcejoncdonagmfohjcdgohnmecaipidc) extension instead. 75 | - Port bindings for Traefik due to the network mode change. 76 | 77 | 78 | ## [2.2.0] - 2021-04-22 79 | 80 | ### Added 81 | 82 | - Using COMPOSER_VERSION environment variable for PHP 7.2-7.4 images. Images new include two composer versions, v2 is default 83 | - Added `mysqli` extension to all containers to support Wordpress and other apps that do not use PDO 84 | - Added `log_bin_trust_function_creators` To MySQL config to enable creating triggers by the users without the SUPER privileges. Otherwise, Magento can't create reindex triggers 85 | 86 | ### Changed 87 | 88 | - Updated xDebug to v3 for PHP 7.4 89 | - Increased memory limit to 3G for PHP 7.3 and 7.4 to handle `composer install` for Magento 90 | - Updated MySQL container settings due to the configuration changes by the vendor 91 | 92 | ### Removed 93 | 94 | - Removed the `recode` extension from PHP 7.4 image 95 | 96 | 97 | ## [2.1.0] - 2020-08-04 98 | 99 | ### Added 100 | 101 | - New PHP 7.4 images 102 | - Added full collection of MySQL and MariaDB containers: + MySQL 8.0, MariaDB 10.2 and MariaDB 10.4 103 | - Added `pcntl` extension to all Dockerfiles (for example needed for multithread static content deploy in Magento 2) 104 | 105 | ### Changed 106 | 107 | - Bump PHP 7.1, 7.2 and 7.3 to Debian Buster release 108 | - Stick to xDebug 2.7.2 for PHP 7.0 and 2.9.5 for PHP 7.1 and 7.2 109 | 110 | ### Removed 111 | 112 | - Removed using custom repository for `libsodium` for PHP 7.1, 7.2 and 7.3 due to migration to Debian Buster release 113 | 114 | 115 | ## [2.0.0] - 2020-05-21 116 | 117 | ### Added 118 | 119 | - Volumes for MySQL databases and migration script `./local_infrastructure/migration/migrate_1.x-2.0.sh` 120 | - Mailhog service on port :8025 121 | 122 | ### Changed 123 | 124 | - Moved to Traefik 2.2 125 | - Model all Dockerfiles to [DockerHub](https://hub.docker.com/repository/docker/defaultvalue/php) 126 | 127 | 128 | ## [1.0.1] - 2019-Nov-06 129 | 130 | ### Added 131 | 132 | - `gruntHttp` entrypoint and respective configurations 133 | - MariaDB 10.3 container -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # Docker-based PHP development infrastructure. From clean Ubuntu to deployed Magento 2 in 4 commands. # 2 | 3 | This is a part of the local infrastructure project which aims to create easy to install and use environment 4 | for PHP development. Based on Ubuntu LTS. 5 | 6 | 1. [Ubuntu post-installation scripts](https://github.com/DefaultValue/ubuntu_post_install_scripts): Install all software PHP development with a single script. 7 | 2. [Dockerizer](https://github.com/DefaultValue/dockerizer_for_php): Add Docker files to your existing projects in one command. Install any Magento 2 version in 1 command. Dockerizer is a tool for easy creation and management of templates for Docker compositions for your PHP applications. You can use it for development or in the CI/CD pipelines. Check [Dockerizer Wiki](https://github.com/DefaultValue/dockerizer_for_php/wiki) to get more information on available commands and what the tool does. 8 | 9 | # Deprecation notice # 10 | 11 | This repository will temporarily keep PHP Dockerfiles, and we plan to move it to a more suitable namespace. 12 | Dockerizer v3.2 includes Traekif composition template, which makes this repository obsolete. 13 | 14 | # Building and testing images # 15 | 16 | 1. Build images with `docker-images-build.sh`. 17 | 2. Run `magento:test-templates` from the [Dockerizer](https://github.com/DefaultValue/dockerizer_for_php) project to test them. 18 | 3. Run `docker-images-build-multiplatform.sh` to build and push images for multiple platforms. 19 | 20 | It is highly recommended to build and test images on at least Linux and MacOS. 21 | 22 | ## Author and maintainer ## 23 | 24 | [Maksym Zaporozhets](mailto:maksimzaporozhets@gmail.com) 25 | 26 | P.S.: We appreciate any help developing this project and still keeping it as 'Docker-native' as possible. Other people should be 27 | able to re-use and easily **extend** containers or compose files for their needs, but not **modify** them. -------------------------------------------------------------------------------- /docker-images-build-multiplatform.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | docker container prune -f 6 | docker image prune -af 7 | 8 | DOCKER_BUILDKIT=1 9 | docker buildx create --name phpbuilder --use 10 | docker buildx inspect --bootstrap 11 | 12 | cd ~/misc/apps/docker_infrastructure/templates/php/5.6/ || exit 13 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:5.6.40-production . -f production.Dockerfile --push 14 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:5.6.40-development . -f development.Dockerfile --push 15 | 16 | cd ~/misc/apps/docker_infrastructure/templates/php/7.0/ || exit 17 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:7.0.33-production . -f production.Dockerfile --push 18 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:7.0.33-development . -f development.Dockerfile --push 19 | 20 | cd ~/misc/apps/docker_infrastructure/templates/php/7.1/ || exit 21 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:7.1.33-production . -f production.Dockerfile --push 22 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:7.1.33-development . -f development.Dockerfile --push 23 | 24 | cd ~/misc/apps/docker_infrastructure/templates/php/7.2/ || exit 25 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:7.2.34-production . -f production.Dockerfile --push 26 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:7.2.34-development . -f development.Dockerfile --push 27 | 28 | cd ~/misc/apps/docker_infrastructure/templates/php/7.3/ || exit 29 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:7.3.33-production . -f production.Dockerfile --push 30 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:7.3.33-development . -f development.Dockerfile --push 31 | 32 | cd ~/misc/apps/docker_infrastructure/templates/php/7.4/ || exit 33 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:7.4.33-production . -f production.Dockerfile --push 34 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:7.4.33-development . -f development.Dockerfile --push 35 | 36 | cd ~/misc/apps/docker_infrastructure/templates/php/8.0/ || exit 37 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:8.0.30-production . -f production.Dockerfile --push 38 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:8.0.30-development . -f development.Dockerfile --push 39 | 40 | cd ~/misc/apps/docker_infrastructure/templates/php/8.1/ || exit 41 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:8.1.27-production . -f production.Dockerfile --push 42 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:8.1.27-development . -f development.Dockerfile --push 43 | 44 | cd ~/misc/apps/docker_infrastructure/templates/php/8.2/ || exit 45 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:8.2.18-production . -f production.Dockerfile --push 46 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:8.2.18-development . -f development.Dockerfile --push 47 | 48 | cd ~/misc/apps/docker_infrastructure/templates/php/8.3/ || exit 49 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:8.3.17-production . -f production.Dockerfile --push 50 | docker buildx build --platform linux/amd64,linux/arm64,linux/arm64/v8 -t defaultvalue/php:8.3.17-development . -f development.Dockerfile --push 51 | 52 | docker buildx stop phpbuilder 53 | docker buildx rm phpbuilder 54 | docker buildx prune --all -f 55 | docker buildx ls -------------------------------------------------------------------------------- /docker-images-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 1. Build development and production images 3 | # 2. Run `DOCKERIZER magento:test dockerfiles` 4 | # 3. Push images 5 | 6 | # Check extensions list and custom PHP configuration file 7 | # docker exec -it $(DOCKERIZER composition:get-container-name php) php -v 8 | # docker exec -it $(DOCKERIZER composition:get-container-name php) php -r 'var_export(get_loaded_extensions());' 9 | # docker exec -it $(DOCKERIZER composition:get-container-name php) php -r 'var_export(get_loaded_extensions(true));' 10 | # docker exec -it $(DOCKERIZER composition:get-container-name php) cat /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 11 | 12 | set -e 13 | 14 | docker container prune -f 15 | docker image prune -af 16 | 17 | cd ~/misc/apps/docker_infrastructure/templates/php/5.6/ || exit 18 | docker build -t defaultvalue/php:5.6.40-production . -f production.Dockerfile 19 | docker build -t defaultvalue/php:5.6.40-development . -f development.Dockerfile 20 | 21 | cd ~/misc/apps/docker_infrastructure/templates/php/7.0/ || exit 22 | docker build -t defaultvalue/php:7.0.33-production . -f production.Dockerfile 23 | docker build -t defaultvalue/php:7.0.33-development . -f development.Dockerfile 24 | 25 | cd ~/misc/apps/docker_infrastructure/templates/php/7.1/ || exit 26 | docker build -t defaultvalue/php:7.1.33-production . -f production.Dockerfile 27 | docker build -t defaultvalue/php:7.1.33-development . -f development.Dockerfile 28 | 29 | cd ~/misc/apps/docker_infrastructure/templates/php/7.2/ || exit 30 | docker build -t defaultvalue/php:7.2.34-production . -f production.Dockerfile 31 | docker build -t defaultvalue/php:7.2.34-development . -f development.Dockerfile 32 | 33 | cd ~/misc/apps/docker_infrastructure/templates/php/7.3/ || exit 34 | docker build -t defaultvalue/php:7.3.33-production . -f production.Dockerfile 35 | docker build -t defaultvalue/php:7.3.33-development . -f development.Dockerfile 36 | 37 | cd ~/misc/apps/docker_infrastructure/templates/php/7.4/ || exit 38 | docker build -t defaultvalue/php:7.4.33-production . -f production.Dockerfile 39 | docker build -t defaultvalue/php:7.4.33-development . -f development.Dockerfile 40 | 41 | cd ~/misc/apps/docker_infrastructure/templates/php/8.0/ || exit 42 | docker build -t defaultvalue/php:8.0.30-production . -f production.Dockerfile 43 | docker build -t defaultvalue/php:8.0.30-development . -f development.Dockerfile 44 | 45 | cd ~/misc/apps/docker_infrastructure/templates/php/8.1/ || exit 46 | docker build -t defaultvalue/php:8.1.27-production . -f production.Dockerfile 47 | docker build -t defaultvalue/php:8.1.27-development . -f development.Dockerfile 48 | 49 | cd ~/misc/apps/docker_infrastructure/templates/php/8.2/ || exit 50 | docker build -t defaultvalue/php:8.2.18-production . -f production.Dockerfile 51 | docker build -t defaultvalue/php:8.2.18-development . -f development.Dockerfile 52 | 53 | cd ~/misc/apps/docker_infrastructure/templates/php/8.3/ || exit 54 | docker build -t defaultvalue/php:8.3.17-production . -f production.Dockerfile 55 | docker build -t defaultvalue/php:8.3.17-development . -f development.Dockerfile -------------------------------------------------------------------------------- /docker-images-push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 1. Build development and production images 3 | # 2. Run `DOCKERIZER magento:test dockerfiles` 4 | # 3. Push images 5 | 6 | # Check extensions list and custom PHP configuration file 7 | # docker exec -it $(DOCKERIZER composition:get-container-name php) php -v 8 | # docker exec -it $(DOCKERIZER composition:get-container-name php) php -r 'var_export(get_loaded_extensions());' 9 | # docker exec -it $(DOCKERIZER composition:get-container-name php) php -r 'var_export(get_loaded_extensions(true));' 10 | # docker exec -it $(DOCKERIZER composition:get-container-name php) cat /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 11 | 12 | set -e 13 | 14 | docker login -u defaultvalue 15 | 16 | docker push defaultvalue/php:5.6.40-production 17 | docker push defaultvalue/php:5.6.40-development 18 | 19 | docker push defaultvalue/php:7.0.33-production 20 | docker push defaultvalue/php:7.0.33-development 21 | 22 | docker push defaultvalue/php:7.1.33-production 23 | docker push defaultvalue/php:7.1.33-development 24 | 25 | docker push defaultvalue/php:7.2.34-production 26 | docker push defaultvalue/php:7.2.34-development 27 | 28 | docker push defaultvalue/php:7.3.33-production 29 | docker push defaultvalue/php:7.3.33-development 30 | 31 | docker push defaultvalue/php:7.4.33-production 32 | docker push defaultvalue/php:7.4.33-development 33 | 34 | docker push defaultvalue/php:8.0.30-production 35 | docker push defaultvalue/php:8.0.30-development 36 | 37 | docker push defaultvalue/php:8.1.27-production 38 | docker push defaultvalue/php:8.1.27-development 39 | 40 | docker push defaultvalue/php:8.2.18-production 41 | docker push defaultvalue/php:8.2.18-development 42 | 43 | docker push defaultvalue/php:8.3.17-production 44 | docker push defaultvalue/php:8.3.17-development -------------------------------------------------------------------------------- /local_infrastructure/configuration/certificates.toml.dist: -------------------------------------------------------------------------------- 1 | [tls] 2 | [[tls.certificates]] 3 | certFile = "/certs/example+1.pem" 4 | keyFile = "/certs/example+1-key.pem" 5 | 6 | [[tls.certificates]] 7 | certFile = "/certs/example2+1.pem" 8 | keyFile = "/certs/example2+1-key.pem" -------------------------------------------------------------------------------- /local_infrastructure/configuration/routes.toml: -------------------------------------------------------------------------------- 1 | [http.routers.dashboard] 2 | rule = "Host(`traefik.docker.local`)" 3 | service = "api@internal" 4 | entryPoints = ["http"] -------------------------------------------------------------------------------- /local_infrastructure/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.7' 2 | 3 | volumes: 4 | mysql56_volume: 5 | name: MySql56-Volume 6 | mysql57_volume: 7 | name: MySql57-Volume 8 | mysql80_volume: 9 | name: MySql80-Volume 10 | mariadb101_volume: 11 | name: MariaDB101-Volume 12 | mariadb102_volume: 13 | name: MariaDB102-Volume 14 | mariadb103_volume: 15 | name: MariaDB103-Volume 16 | mariadb104_volume: 17 | name: MariaDB104-Volume 18 | 19 | services: 20 | reverse-proxy: 21 | image: traefik:v2.2 22 | container_name: "reverse-proxy" 23 | restart: always 24 | network_mode: host 25 | volumes: 26 | - /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events 27 | - ./traefik.toml:/traefik.toml 28 | - ./configuration/:/configuration/ 29 | - ${SSL_CERTIFICATES_DIR}:/certs/ 30 | 31 | mysql56: 32 | container_name: mysql56 33 | image: mysql:5.6 34 | restart: always 35 | labels: 36 | - traefik.enable=false 37 | network_mode: bridge 38 | ports: 39 | - 3356:3306 40 | environment: 41 | - MYSQL_ROOT_PASSWORD=root 42 | - MYSQL_PASSWORD=root 43 | volumes: 44 | - mysql56_volume:/var/lib/mysql 45 | - ./my.cnf:/etc/my.cnf 46 | 47 | mysql57: 48 | container_name: mysql57 49 | image: mysql:5.7 50 | restart: always 51 | labels: 52 | - traefik.enable=false 53 | network_mode: bridge 54 | ports: 55 | - 3357:3306 56 | environment: 57 | - MYSQL_ROOT_PASSWORD=root 58 | - MYSQL_PASSWORD=root 59 | volumes: 60 | - mysql57_volume:/var/lib/mysql 61 | - ./my.cnf:/etc/my.cnf 62 | 63 | mysql80: 64 | container_name: mysql80 65 | image: mysql:8.0 66 | restart: always 67 | labels: 68 | - traefik.enable=false 69 | network_mode: bridge 70 | ports: 71 | - 3380:3306 72 | environment: 73 | - MYSQL_ROOT_PASSWORD=root 74 | - MYSQL_PASSWORD=root 75 | volumes: 76 | - mysql80_volume:/var/lib/mysql 77 | - ./my.cnf:/etc/my.cnf 78 | 79 | mariadb101: 80 | container_name: mariadb101 81 | image: bitnami/mariadb:10.1 82 | user: root 83 | restart: always 84 | labels: 85 | - traefik.enable=false 86 | network_mode: bridge 87 | ports: 88 | - 33101:3306 89 | environment: 90 | - MARIADB_ROOT_USER=root 91 | - MARIADB_ROOT_PASSWORD=root 92 | volumes: 93 | - mariadb101_volume:/bitnami/mariadb 94 | - ./my.cnf:/etc/my.cnf 95 | 96 | mariadb102: 97 | container_name: mariadb102 98 | image: bitnami/mariadb:10.2 99 | user: root 100 | restart: always 101 | labels: 102 | - traefik.enable=false 103 | network_mode: bridge 104 | ports: 105 | - 33102:3306 106 | environment: 107 | - MARIADB_ROOT_USER=root 108 | - MARIADB_ROOT_PASSWORD=root 109 | volumes: 110 | - mariadb102_volume:/bitnami/mariadb 111 | - ./my.cnf:/etc/my.cnf 112 | 113 | mariadb103: 114 | container_name: mariadb103 115 | image: bitnami/mariadb:10.3 116 | user: root 117 | restart: always 118 | labels: 119 | - traefik.enable=false 120 | network_mode: bridge 121 | ports: 122 | - 33103:3306 123 | environment: 124 | - MARIADB_ROOT_USER=root 125 | - MARIADB_ROOT_PASSWORD=root 126 | volumes: 127 | - mariadb103_volume:/bitnami/mariadb 128 | - ./my.cnf:/etc/my.cnf 129 | 130 | mariadb104: 131 | container_name: mariadb104 132 | image: bitnami/mariadb:10.4 133 | user: root 134 | restart: always 135 | labels: 136 | - traefik.enable=false 137 | network_mode: bridge 138 | ports: 139 | - 33104:3306 140 | environment: 141 | - MARIADB_ROOT_USER=root 142 | - MARIADB_ROOT_PASSWORD=root 143 | volumes: 144 | - mariadb104_volume:/bitnami/mariadb 145 | - ./my.cnf:/etc/my.cnf 146 | 147 | phpmyadmin: 148 | container_name: phpmyadmin 149 | image: phpmyadmin/phpmyadmin 150 | restart: always 151 | labels: 152 | - traefik.enable=true 153 | - traefik.http.routers.phpmyadmin-http.rule=Host(`phpmyadmin.docker.local`) 154 | - traefik.http.routers.phpmyadmin-http.entrypoints=http 155 | network_mode: bridge 156 | depends_on: 157 | - reverse-proxy 158 | - mysql56 159 | - mysql57 160 | - mysql80 161 | - mariadb101 162 | - mariadb102 163 | - mariadb103 164 | - mariadb104 165 | links: 166 | - mysql56:mysql56 167 | - mysql57:mysql57 168 | - mysql80:mysql80 169 | - mariadb101:mariadb101 170 | - mariadb102:mariadb102 171 | - mariadb103:mariadb103 172 | - mariadb104:mariadb104 173 | environment: 174 | - PMA_HOSTS=mysql57,mysql80,mysql56,mariadb101,mariadb102,mariadb103,mariadb104 175 | - PMA_USER=root 176 | - PMA_PASSWORD=root 177 | - PMA_ABSOLUTE_URI=http://phpmyadmin.docker.local/ 178 | volumes: 179 | - /sessions 180 | 181 | mailhog: 182 | container_name: mailhog 183 | image: mailhog/mailhog:v1.0.1 184 | restart: always 185 | network_mode: bridge 186 | labels: 187 | - traefik.enable=true 188 | - traefik.http.routers.mailhog-http.rule=Host(`mailhog.docker.local`) 189 | - traefik.http.routers.mailhog-http.entrypoints=http 190 | - traefik.http.services.mailhog-http.loadbalancer.server.port=8025 -------------------------------------------------------------------------------- /local_infrastructure/migration/migrate_1.x-2.0.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ### 3 | # Migration script for Ubuntu 18.04 where all files were located in the "/misc/apps/" folder 4 | # Change paths for "PROJECTS_ROOT_DIR" and "SSL_CERTIFICATES_DIR" if your files are located elsewhere 5 | ### 6 | sudo -k 7 | 8 | if ! [ $(sudo id -u) = 0 ]; then 9 | echo "\033[31;1m" 10 | echo "Root password was not entered correctly!" 11 | exit 1; 12 | fi 13 | 14 | export PROJECTS_ROOT_DIR=/misc/apps/ 15 | export SSL_CERTIFICATES_DIR=/misc/share/ssl/ 16 | export EXECUTION_ENVIRONMENT=development 17 | 18 | echo " 19 | export PROJECTS_ROOT_DIR=/misc/apps/ 20 | export SSL_CERTIFICATES_DIR=/misc/share/ssl/ 21 | export EXECUTION_ENVIRONMENT=development" >> ~/.bash_aliases 22 | 23 | cd ${PROJECTS_ROOT_DIR}dockerizer_for_php/ || exit 24 | git config core.fileMode false 25 | git reset --hard HEAD 26 | git pull origin master 27 | rm -rf vendor/* 28 | composer install 29 | 30 | cd ${PROJECTS_ROOT_DIR}docker_infrastructure/local_infrastructure/ || exit 31 | # Stop infrastructure 32 | docker-compose down 33 | cd .. 34 | git config core.fileMode false 35 | git reset --hard HEAD 36 | git pull origin master 37 | cd ./local_infrastructure/ || exit 38 | 39 | # Create external docker network 40 | echo " 41 | 127.0.0.1 traefik.docker.local" | sudo tee -a /etc/hosts 42 | 43 | # Start infrastructure to create volumes 44 | docker-compose up -d --force-recreate --build 45 | 46 | # Copy databases data vo volumes 47 | echo "Starting data importing..." 48 | 49 | echo "Import data for MySQL56..." 50 | sudo docker cp ./mysql56_databases/. mysql56:/var/lib/mysql 51 | sudo rm -rf ./mysql56_databases/ 52 | echo "Import data for MySQL56 completed" 53 | 54 | echo "Import data for MySQL57..." 55 | sudo docker cp ./mysql57_databases/. mysql57:/var/lib/mysql 56 | sudo rm -rf ./mysql57_databases/ 57 | echo "Import data for MySQL57 completed" 58 | 59 | echo "Import data for MariaDB101..." 60 | sudo docker cp ./mariadb101_databases/data/. mariadb101:/bitnami/mariadb/data/ 61 | sudo rm -rf ./mariadb101_databases/ 62 | echo "Import data for MariaDB101 completed" 63 | 64 | echo "Import data for MariaDB103..." 65 | sudo docker cp ./mariadb103_databases/data/. mariadb103:/bitnami/mariadb/data/ 66 | sudo rm -rf ./mariadb103_databases/ 67 | echo "Import data for MariaDB103 completed" 68 | 69 | echo "All imports completed" 70 | echo "Restarting infrastructure..." 71 | 72 | new_certificates=./configuration/certificates.toml 73 | touch $new_certificates 74 | 75 | echo "[tls]" >> $new_certificates 76 | 77 | readarray -t certificates_lines < ./traefik_rules/rules.toml 78 | 79 | for line in "${certificates_lines[@]}" 80 | do 81 | : 82 | if [ "$line" == '[[tls]]' ]; then 83 | echo " [[tls.certificates]]" >> $new_certificates 84 | continue 85 | elif [ "$line" == *"entryPoints = [\"https\"]"* ] || [[ "$line" == *"tls.certificate"* ]] || [[ $line == *"entryPoints"* ]]; then 86 | continue 87 | else 88 | echo "$line" >> $new_certificates 89 | fi 90 | done 91 | 92 | docker-compose down 93 | docker-compose up -d 94 | 95 | rm -rf ./traefik_rules 96 | 97 | echo "/********************** 98 | * 99 | * Migration Completed! 100 | * 101 | * Infrastructure URLS (open and save these URLs to bookmarks): 102 | * - Docker dashboard URL - http://traefik.docker.local/ 103 | * - phpMyAdmin URL - http://phpmyadmin.docker.local/ 104 | * 105 | * Please, close all applications and reboot! 106 | * 107 | \********************** 108 | " -------------------------------------------------------------------------------- /local_infrastructure/migration/update-2.0.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd ${PROJECTS_ROOT_DIR}docker_infrastructure/local_infrastructure/ || exit; 4 | 5 | cd ${PROJECTS_ROOT_DIR}dockerizer_for_php/ || exit; 6 | git pull origin master 7 | rm -rf ./vendor/* 8 | composer install 9 | 10 | cd ${PROJECTS_ROOT_DIR}docker_infrastructure/ 11 | git pull origin master 12 | 13 | docker pull traefik:v2.2 14 | docker pull mysql:5.6 15 | docker pull mysql:5.7 16 | docker pull mysql:8.0 17 | docker pull bitnami/mariadb:10.1 18 | docker pull bitnami/mariadb:10.2 19 | docker pull bitnami/mariadb:10.3 20 | docker pull bitnami/mariadb:10.4 21 | docker pull phpmyadmin/phpmyadmin 22 | docker pull mailhog/mailhog:v1.0.1 23 | 24 | docker pull defaultvalue/php:5.6-development 25 | docker pull defaultvalue/php:5.6-production 26 | docker pull defaultvalue/php:7.0-development 27 | docker pull defaultvalue/php:7.0-production 28 | docker pull defaultvalue/php:7.1-development 29 | docker pull defaultvalue/php:7.1-production 30 | docker pull defaultvalue/php:7.2-development 31 | docker pull defaultvalue/php:7.2-production 32 | docker pull defaultvalue/php:7.3-development 33 | docker pull defaultvalue/php:7.3-production 34 | docker pull defaultvalue/php:7.4-development 35 | docker pull defaultvalue/php:7.4-production 36 | 37 | cd ${PROJECTS_ROOT_DIR}docker_infrastructure/local_infrastructure/ 38 | docker-compose up -d --force-recreate 39 | 40 | echo "Please, reboot!" -------------------------------------------------------------------------------- /local_infrastructure/my.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | wait_timeout=28800 3 | max_allowed_packet=128M 4 | innodb_log_file_size=128M 5 | innodb_buffer_pool_size=1G 6 | log_bin_trust_function_creators=1 7 | 8 | [mysql] 9 | auto-rehash -------------------------------------------------------------------------------- /local_infrastructure/traefik.toml: -------------------------------------------------------------------------------- 1 | [global] 2 | sendAnonymousUsage = false 3 | 4 | [log] 5 | level = "WARN" #DEBUG, INFO, WARN, ERROR, FATAL, PANIC 6 | format = "common" 7 | 8 | [serversTransport] 9 | insecureSkipVerify = true 10 | 11 | [entryPoints] 12 | [entryPoints.http] 13 | address = ":80" 14 | 15 | [entryPoints.https] 16 | address = ":443" 17 | 18 | [providers] 19 | [providers.file] 20 | directory = "/configuration/" 21 | watch = true 22 | 23 | [providers.docker] 24 | exposedbydefault = false 25 | 26 | [api] 27 | dashboard = true 28 | -------------------------------------------------------------------------------- /templates/php/5.6/development.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM defaultvalue/php:5.6.40-production 2 | 3 | RUN cat /usr/local/etc/php/php.ini-development > /usr/local/etc/php/php.ini 4 | 5 | # Compile xDebug from source - https://github.com/docker-library/php/issues/133#issuecomment-488030185 6 | RUN BEFORE_PWD=$(pwd) \ 7 | && mkdir -p /opt/xdebug \ 8 | && cd /opt/xdebug \ 9 | && curl -k -L https://github.com/xdebug/xdebug/archive/XDEBUG_2_5_5.tar.gz | tar zx \ 10 | && cd xdebug-XDEBUG_2_5_5 \ 11 | && phpize \ 12 | && ./configure --enable-xdebug \ 13 | && make clean \ 14 | && sed -i 's/-O2/-O0/g' Makefile \ 15 | && make \ 16 | # && make test \ 17 | && make install \ 18 | && cd "${BEFORE_PWD}" \ 19 | && rm -r /opt/xdebug \ 20 | && docker-php-ext-enable xdebug \ 21 | && echo 'xdebug.remote_enable=1\n\ 22 | xdebug.idekey="PHPSTORM"\n\ 23 | xdebug.remote_port=9000\n\ 24 | xdebug.remote_connect_back=0\n\ 25 | xdebug.remote_autostart=1\n\ 26 | xdebug.remote_host=host.docker.internal' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 27 | 28 | # Grunt uses Magento 2 CLI commands. Need to install it for development 29 | RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \ 30 | && apt install nodejs -y \ 31 | && npm install -g grunt-cli 32 | 33 | # Install mhsendmail - Sendmail replacement for Mailhog 34 | RUN curl -sL https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 --output /usr/bin/mhsendmail \ 35 | && chmod +x /usr/bin/mhsendmail \ 36 | && echo 'sendmail_path="/usr/bin/mhsendmail -t --smtp-addr=mailhog:1025"' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 37 | 38 | RUN rm -r /var/lib/apt/lists/* \ 39 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/5.6/production.Dockerfile: -------------------------------------------------------------------------------- 1 | # PHP 5.6.40 removal: https://github.com/docker-library/php/commit/e9320fdb752edb2fb5d1be8412172f5c78255a45 2 | FROM php:5.6.40-apache-stretch 3 | 4 | # Based on https://unix.stackexchange.com/questions/743839/apt-get-update-failed-to-fetch-debian-amd64-packages-while-building-dockerfile-f 5 | # and https://serverfault.com/questions/1074688/security-debian-org-does-not-have-a-release-file-on-with-debian-docker-images 6 | RUN echo 'deb http://archive.debian.org/debian stretch main' > /etc/apt/sources.list \ 7 | && sed -i 's/stable\/updates/stable-security\/updates/' /etc/apt/sources.list 8 | 9 | # Install packages 10 | RUN apt update \ 11 | && apt upgrade -y \ 12 | && apt install -y \ 13 | cron \ 14 | curl \ 15 | git \ 16 | zip \ 17 | unzip \ 18 | libicu-dev \ 19 | libpng-dev \ 20 | libxml2-dev \ 21 | zlib1g-dev \ 22 | libxslt1-dev \ 23 | libmagickwand-dev \ 24 | librecode0 \ 25 | librecode-dev \ 26 | libzip-dev \ 27 | libmcrypt-dev \ 28 | --no-install-recommends 29 | 30 | # Download and install memcached from the archive. Ignore: curl: (60) SSL certificate problem: certificate has expired 31 | # https://pecl.php.net/package/memcached (2.2.0 for PHP 5.6, 3.2.0 for PHP 7.0.0 or newer) 32 | RUN apt install -y memcached libmemcached-dev \ 33 | && curl --insecure 'https://pecl.php.net/get/memcached-2.2.0.tgz' -o memcached-2.2.0.tgz \ 34 | && pecl install --offline memcached-2.2.0.tgz \ 35 | && docker-php-ext-enable memcached \ 36 | && rm memcached-2.2.0.tgz 37 | 38 | # Install imagick 3.7.0: https://pecl.php.net/package/imagick (PHP 5.4.0 or newer) 39 | RUN curl --insecure https://pecl.php.net/get/imagick-3.7.0.tgz -o imagick-3.7.0.tgz \ 40 | && pecl install --offline imagick-3.7.0.tgz \ 41 | && docker-php-ext-enable imagick \ 42 | && rm imagick-3.7.0.tgz 43 | 44 | # Install Redis: https://pecl.php.net/package/redis \ 45 | # 2.2.8 for PHP 5.6, 5.3.7 for PHP 7.0.0 or newer 46 | RUN curl --insecure https://pecl.php.net/get/redis-2.2.8.tgz -o redis-2.2.8.tgz \ 47 | && pecl install --offline redis-2.2.8.tgz \ 48 | && docker-php-ext-enable redis \ 49 | && rm redis-2.2.8.tgz 50 | 51 | # https://pear.php.net/package/MIME_Type/download 52 | RUN curl http://download.pear.php.net/package/MIME_Type-1.4.1.tgz -o MIME_Type.tgz \ 53 | && pear install MIME_Type.tgz \ 54 | && rm MIME_Type.tgz 55 | 56 | # Configure GD2 installation options 57 | RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 58 | 59 | # Install PHP Extensions 60 | RUN docker-php-ext-install gd intl mysqli opcache pcntl pdo_mysql recode soap xml xmlrpc xsl zip bcmath mcrypt 61 | 62 | RUN echo 'always_populate_raw_post_data=-1\n\ 63 | memory_limit=2048M\n\ 64 | realpath_cache_size=10M\n\ 65 | realpath_cache_ttl=7200\n\ 66 | opcache.enable=1\n\ 67 | opcache.validate_timestamps=1\n\ 68 | opcache.revalidate_freq=1\n\ 69 | opcache.max_wasted_percentage=10\n\ 70 | opcache.memory_consumption=256\n\ 71 | opcache.max_accelerated_files=20000' > /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 72 | 73 | RUN a2enmod rewrite proxy proxy_http ssl headers expires 74 | 75 | # Must use the same UID/GUI as on the local system for the shared files to be editable on both systems 76 | RUN groupadd -g 1000 docker \ 77 | && useradd -u 1000 -g docker -m docker 78 | 79 | RUN curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer1 --1 \ 80 | && curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer2 \ 81 | && su docker -c "composer1 global require hirak/prestissimo" 82 | 83 | RUN echo '#!/bin/sh\n\ 84 | composerVersion="${COMPOSER_VERSION:-2}"\n\ 85 | # Magento requires up to 6GB RAM for `composer create-project` and `composer install` to run (2.1.18)\n\ 86 | composerCommand="php -d memory_limit=6144M /usr/local/bin/composer${composerVersion}"\n\ 87 | $composerCommand "$@"' > /usr/local/bin/composer \ 88 | && chmod +x /usr/local/bin/composer 89 | 90 | RUN cat /usr/local/etc/php/php.ini-production > /usr/local/etc/php/php.ini 91 | 92 | RUN rm -r /var/lib/apt/lists/* \ 93 | && rm -rf /tmp/pear/ 94 | -------------------------------------------------------------------------------- /templates/php/7.0/development.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM defaultvalue/php:7.0.33-production 2 | 3 | RUN cat /usr/local/etc/php/php.ini-development > /usr/local/etc/php/php.ini 4 | 5 | RUN pecl install xdebug-2.7.2 \ 6 | && docker-php-ext-enable xdebug \ 7 | && echo 'xdebug.remote_enable=1\n\ 8 | xdebug.idekey="PHPSTORM"\n\ 9 | xdebug.remote_port=9000\n\ 10 | xdebug.remote_connect_back=0\n\ 11 | xdebug.remote_autostart=1\n\ 12 | xdebug.remote_host=host.docker.internal' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 13 | 14 | # Grunt uses Magento 2 CLI commands. Need to install it for development 15 | RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \ 16 | && apt install nodejs -y \ 17 | && npm install -g grunt-cli 18 | 19 | # Install mhsendmail - Sendmail replacement for Mailhog 20 | RUN curl -sL https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 --output /usr/bin/mhsendmail \ 21 | && chmod +x /usr/bin/mhsendmail \ 22 | && echo 'sendmail_path="/usr/bin/mhsendmail -t --smtp-addr=mailhog:1025"' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 23 | 24 | RUN rm -r /var/lib/apt/lists/* \ 25 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/7.0/production.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.0.33-apache-stretch 2 | 3 | # Based on https://unix.stackexchange.com/questions/743839/apt-get-update-failed-to-fetch-debian-amd64-packages-while-building-dockerfile-f 4 | # and https://serverfault.com/questions/1074688/security-debian-org-does-not-have-a-release-file-on-with-debian-docker-images 5 | RUN echo 'deb http://archive.debian.org/debian stretch main' > /etc/apt/sources.list \ 6 | && sed -i 's/stable\/updates/stable-security\/updates/' /etc/apt/sources.list 7 | 8 | # Install packages 9 | RUN apt update \ 10 | && apt upgrade -y \ 11 | && apt install -y \ 12 | cron \ 13 | curl \ 14 | git \ 15 | zip \ 16 | unzip \ 17 | libicu-dev \ 18 | libpng-dev \ 19 | libxml2-dev \ 20 | zlib1g-dev \ 21 | libxslt1-dev \ 22 | libmagickwand-dev \ 23 | librecode0 \ 24 | librecode-dev \ 25 | libzip-dev \ 26 | libmcrypt-dev \ 27 | --no-install-recommends 28 | 29 | RUN apt install -y memcached libmemcached-dev \ 30 | && pecl install memcached \ 31 | && docker-php-ext-enable memcached 32 | 33 | RUN pecl install imagick \ 34 | && docker-php-ext-enable imagick 35 | 36 | RUN pecl install redis-5.3.7 \ 37 | && docker-php-ext-enable redis 38 | 39 | RUN pear install MIME_Type 40 | 41 | # Configure GD2 installation options 42 | RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 43 | 44 | # Install PHP Extensions 45 | RUN docker-php-ext-install gd intl mysqli opcache pcntl pdo_mysql soap xml xmlrpc xsl zip bcmath mcrypt recode 46 | 47 | RUN echo 'always_populate_raw_post_data=-1\n\ 48 | memory_limit=2048M\n\ 49 | realpath_cache_size=10M\n\ 50 | realpath_cache_ttl=7200\n\ 51 | opcache.enable=1\n\ 52 | opcache.validate_timestamps=1\n\ 53 | opcache.revalidate_freq=1\n\ 54 | opcache.max_wasted_percentage=10\n\ 55 | opcache.memory_consumption=256\n\ 56 | opcache.max_accelerated_files=20000' > /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 57 | 58 | RUN a2enmod rewrite proxy proxy_http ssl headers expires 59 | 60 | # Must use the same UID/GUI as on the local system for the shared files to be editable on both systems 61 | RUN groupadd -g 1000 docker \ 62 | && useradd -u 1000 -g docker -m docker 63 | 64 | RUN curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer1 --1 \ 65 | && curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer2 \ 66 | && su docker -c "composer1 global require hirak/prestissimo" 67 | 68 | RUN echo '#!/bin/sh\n\ 69 | composerVersion="${COMPOSER_VERSION:-2}"\n\ 70 | # Magento requires up to 4GB RAM for `composer create-project` and `composer install` to run\n\ 71 | composerCommand="php -d memory_limit=4096M /usr/local/bin/composer${composerVersion}"\n\ 72 | $composerCommand "$@"' > /usr/local/bin/composer \ 73 | && chmod +x /usr/local/bin/composer 74 | 75 | RUN cat /usr/local/etc/php/php.ini-production > /usr/local/etc/php/php.ini 76 | 77 | RUN rm -r /var/lib/apt/lists/* \ 78 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/7.1/development.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM defaultvalue/php:7.1.33-production 2 | 3 | RUN cat /usr/local/etc/php/php.ini-development > /usr/local/etc/php/php.ini 4 | 5 | RUN pecl install xdebug-2.9.8 \ 6 | && docker-php-ext-enable xdebug \ 7 | && echo 'xdebug.remote_enable=1\n\ 8 | xdebug.idekey="PHPSTORM"\n\ 9 | xdebug.remote_port=9000\n\ 10 | xdebug.remote_connect_back=0\n\ 11 | xdebug.remote_autostart=1\n\ 12 | xdebug.remote_host=host.docker.internal' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 13 | 14 | # Grunt uses Magento 2 CLI commands. Need to install it for development 15 | RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \ 16 | && apt install nodejs -y \ 17 | && npm install -g grunt-cli 18 | 19 | # Install mhsendmail - Sendmail replacement for Mailhog 20 | RUN curl -sL https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 --output /usr/bin/mhsendmail \ 21 | && chmod +x /usr/bin/mhsendmail \ 22 | && echo 'sendmail_path="/usr/bin/mhsendmail -t --smtp-addr=mailhog:1025"' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 23 | 24 | RUN rm -r /var/lib/apt/lists/* \ 25 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/7.1/production.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.1.33-apache-buster 2 | 3 | # Install packages 4 | RUN apt update \ 5 | && apt upgrade -y \ 6 | && apt install -y \ 7 | cron \ 8 | curl \ 9 | git \ 10 | zip \ 11 | unzip \ 12 | libicu-dev \ 13 | libpng-dev \ 14 | libxml2-dev \ 15 | zlib1g-dev \ 16 | libxslt1-dev \ 17 | libmagickwand-dev \ 18 | librecode0 \ 19 | librecode-dev \ 20 | libzip-dev \ 21 | libmcrypt-dev \ 22 | --no-install-recommends 23 | 24 | RUN apt install -y memcached libmemcached-dev \ 25 | && pecl install memcached \ 26 | && docker-php-ext-enable memcached 27 | 28 | RUN pecl install imagick \ 29 | && docker-php-ext-enable imagick 30 | 31 | RUN pecl install redis-5.3.7 \ 32 | && docker-php-ext-enable redis 33 | 34 | RUN pear install MIME_Type 35 | 36 | # Configure GD2 installation options 37 | RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 38 | 39 | # Install PHP Extensions 40 | RUN docker-php-ext-install gd intl mysqli opcache pcntl pdo_mysql soap xml xmlrpc xsl zip bcmath mcrypt recode sockets 41 | 42 | RUN echo 'always_populate_raw_post_data=-1\n\ 43 | memory_limit=2048M\n\ 44 | realpath_cache_size=10M\n\ 45 | realpath_cache_ttl=7200\n\ 46 | opcache.enable=1\n\ 47 | opcache.validate_timestamps=1\n\ 48 | opcache.revalidate_freq=1\n\ 49 | opcache.max_wasted_percentage=10\n\ 50 | opcache.memory_consumption=256\n\ 51 | opcache.max_accelerated_files=20000' > /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 52 | 53 | RUN a2enmod rewrite proxy proxy_http ssl headers expires 54 | 55 | # Must use the same UID/GUI as on the local system for the shared files to be editable on both systems 56 | RUN groupadd -g 1000 docker \ 57 | && useradd -u 1000 -g docker -m docker 58 | 59 | RUN curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer1 --1 \ 60 | && curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer2 \ 61 | && su docker -c "composer1 global require hirak/prestissimo" 62 | 63 | RUN echo '#!/bin/sh\n\ 64 | composerVersion="${COMPOSER_VERSION:-2}"\n\ 65 | # Magento requires up to 4GB RAM for `composer create-project` and `composer install` to run\n\ 66 | composerCommand="php -d memory_limit=4096M /usr/local/bin/composer${composerVersion}"\n\ 67 | $composerCommand "$@"' > /usr/local/bin/composer \ 68 | && chmod +x /usr/local/bin/composer 69 | 70 | RUN cat /usr/local/etc/php/php.ini-production > /usr/local/etc/php/php.ini 71 | 72 | RUN rm -r /var/lib/apt/lists/* \ 73 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/7.2/development.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM defaultvalue/php:7.2.34-production 2 | 3 | RUN cat /usr/local/etc/php/php.ini-development > /usr/local/etc/php/php.ini 4 | 5 | RUN pecl install xdebug-2.9.8 \ 6 | && docker-php-ext-enable xdebug \ 7 | && echo 'xdebug.remote_enable=1\n\ 8 | xdebug.idekey="PHPSTORM"\n\ 9 | xdebug.remote_port=9000\n\ 10 | xdebug.remote_connect_back=0\n\ 11 | xdebug.remote_autostart=1\n\ 12 | xdebug.remote_host=host.docker.internal' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 13 | 14 | # Grunt uses Magento 2 CLI commands. Need to install it for development 15 | RUN curl -sL https://deb.nodesource.com/setup_15.x | bash - \ 16 | && apt install nodejs -y \ 17 | && npm install -g grunt-cli 18 | 19 | # Install mhsendmail - Sendmail replacement for Mailhog 20 | RUN curl -sL https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 --output /usr/bin/mhsendmail \ 21 | && chmod +x /usr/bin/mhsendmail \ 22 | && echo 'sendmail_path="/usr/bin/mhsendmail -t --smtp-addr=mailhog:1025"' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 23 | 24 | RUN rm -r /var/lib/apt/lists/* \ 25 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/7.2/production.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.2.34-apache-buster 2 | 3 | # Install packages 4 | RUN apt update \ 5 | && apt upgrade -y \ 6 | && apt install -y \ 7 | cron \ 8 | curl \ 9 | git \ 10 | zip \ 11 | unzip \ 12 | libicu-dev \ 13 | libpng-dev \ 14 | libxml2-dev \ 15 | zlib1g-dev \ 16 | libxslt1-dev \ 17 | libmagickwand-dev \ 18 | librecode0 \ 19 | librecode-dev \ 20 | libzip-dev \ 21 | libsodium-dev \ 22 | --no-install-recommends 23 | 24 | RUN apt install -y memcached libmemcached-dev \ 25 | && pecl install memcached \ 26 | && docker-php-ext-enable memcached 27 | 28 | RUN pecl install imagick \ 29 | && docker-php-ext-enable imagick 30 | 31 | RUN pecl install redis \ 32 | && docker-php-ext-enable redis 33 | 34 | RUN pear install MIME_Type 35 | 36 | # Configure GD2 installation options 37 | RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 38 | 39 | # Install PHP Extensions 40 | RUN docker-php-ext-install gd intl mysqli opcache pcntl pdo_mysql soap xml xmlrpc xsl zip bcmath sodium recode sockets 41 | 42 | RUN echo 'always_populate_raw_post_data=-1\n\ 43 | memory_limit=2048M\n\ 44 | realpath_cache_size=10M\n\ 45 | realpath_cache_ttl=7200\n\ 46 | opcache.enable=1\n\ 47 | opcache.validate_timestamps=1\n\ 48 | opcache.revalidate_freq=1\n\ 49 | opcache.max_wasted_percentage=10\n\ 50 | opcache.memory_consumption=256\n\ 51 | opcache.max_accelerated_files=20000' > /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 52 | 53 | RUN a2enmod rewrite proxy proxy_http ssl headers expires 54 | 55 | # Must use the same UID/GUI as on the local system for the shared files to be editable on both systems 56 | RUN groupadd -g 1000 docker \ 57 | && useradd -u 1000 -g docker -m docker 58 | 59 | RUN curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer1 --1 \ 60 | && curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer2 \ 61 | && su docker -c "composer1 global require hirak/prestissimo" 62 | 63 | RUN echo '#!/bin/sh\n\ 64 | composerVersion="${COMPOSER_VERSION:-2}"\n\ 65 | # Magento requires up to 4GB RAM for `composer create-project` and `composer install` to run\n\ 66 | composerCommand="php -d memory_limit=4096M /usr/local/bin/composer${composerVersion}"\n\ 67 | $composerCommand "$@"' > /usr/local/bin/composer \ 68 | && chmod +x /usr/local/bin/composer 69 | 70 | RUN cat /usr/local/etc/php/php.ini-production > /usr/local/etc/php/php.ini 71 | 72 | RUN rm -r /var/lib/apt/lists/* \ 73 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/7.3/development.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM defaultvalue/php:7.3.33-production 2 | 3 | RUN cat /usr/local/etc/php/php.ini-development > /usr/local/etc/php/php.ini 4 | 5 | RUN pecl install xdebug-2.9.8 \ 6 | && docker-php-ext-enable xdebug \ 7 | && echo 'xdebug.remote_enable=1\n\ 8 | xdebug.idekey="PHPSTORM"\n\ 9 | xdebug.remote_port=9000\n\ 10 | xdebug.remote_connect_back=0\n\ 11 | xdebug.remote_autostart=1\n\ 12 | xdebug.remote_host=host.docker.internal' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 13 | 14 | # Grunt uses Magento 2 CLI commands. Need to install it for development 15 | RUN curl -sL https://deb.nodesource.com/setup_15.x | bash - \ 16 | && apt install nodejs -y \ 17 | && npm install -g grunt-cli 18 | 19 | # Install mhsendmail - Sendmail replacement for Mailhog 20 | RUN curl -sL https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 --output /usr/bin/mhsendmail \ 21 | && chmod +x /usr/bin/mhsendmail \ 22 | && echo 'sendmail_path="/usr/bin/mhsendmail -t --smtp-addr=mailhog:1025"' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 23 | 24 | RUN rm -r /var/lib/apt/lists/* \ 25 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/7.3/production.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.3.33-apache-bullseye 2 | 3 | # Install packages 4 | RUN apt update \ 5 | && apt upgrade -y \ 6 | && apt install -y \ 7 | cron \ 8 | curl \ 9 | git \ 10 | zip \ 11 | unzip \ 12 | libicu-dev \ 13 | libpng-dev \ 14 | libxml2-dev \ 15 | zlib1g-dev \ 16 | libxslt1-dev \ 17 | libmagickwand-dev \ 18 | librecode0 \ 19 | librecode-dev \ 20 | libzip-dev \ 21 | libsodium-dev \ 22 | --no-install-recommends 23 | 24 | RUN apt install -y memcached libmemcached-dev \ 25 | && pecl install memcached \ 26 | && docker-php-ext-enable memcached 27 | 28 | RUN pecl install imagick \ 29 | && docker-php-ext-enable imagick 30 | 31 | RUN pecl install redis \ 32 | && docker-php-ext-enable redis 33 | 34 | RUN pear install MIME_Type 35 | 36 | # Configure GD2 installation options 37 | RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 38 | 39 | # Install PHP Extensions 40 | RUN docker-php-ext-install gd intl mysqli opcache pcntl pdo_mysql soap xml xmlrpc xsl zip bcmath sodium recode sockets 41 | 42 | RUN echo 'always_populate_raw_post_data=-1\n\ 43 | memory_limit=2048M\n\ 44 | realpath_cache_size=10M\n\ 45 | realpath_cache_ttl=7200\n\ 46 | opcache.enable=1\n\ 47 | opcache.validate_timestamps=1\n\ 48 | opcache.revalidate_freq=1\n\ 49 | opcache.max_wasted_percentage=10\n\ 50 | opcache.memory_consumption=256\n\ 51 | opcache.max_accelerated_files=20000' > /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 52 | 53 | RUN a2enmod rewrite proxy proxy_http ssl headers expires 54 | 55 | # Must use the same UID/GUI as on the local system for the shared files to be editable on both systems 56 | RUN groupadd -g 1000 docker \ 57 | && useradd -u 1000 -g docker -m docker 58 | 59 | RUN curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer1 --1 \ 60 | && curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer2 \ 61 | && su docker -c "composer1 global require hirak/prestissimo" 62 | 63 | RUN echo '#!/bin/sh\n\ 64 | composerVersion="${COMPOSER_VERSION:-2}"\n\ 65 | # Magento requires up to 4GB RAM for `composer create-project` and `composer install` to run\n\ 66 | composerCommand="php -d memory_limit=4096M /usr/local/bin/composer${composerVersion}"\n\ 67 | $composerCommand "$@"' > /usr/local/bin/composer \ 68 | && chmod +x /usr/local/bin/composer 69 | 70 | RUN cat /usr/local/etc/php/php.ini-production > /usr/local/etc/php/php.ini 71 | 72 | RUN rm -r /var/lib/apt/lists/* \ 73 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/7.4/development.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM defaultvalue/php:7.4.33-production 2 | 3 | RUN cat /usr/local/etc/php/php.ini-development > /usr/local/etc/php/php.ini 4 | 5 | RUN pecl install xdebug-2.9.8 \ 6 | && docker-php-ext-enable xdebug \ 7 | && echo 'xdebug.remote_enable=1\n\ 8 | xdebug.idekey="PHPSTORM"\n\ 9 | xdebug.remote_port=9000\n\ 10 | xdebug.remote_connect_back=0\n\ 11 | xdebug.remote_autostart=1\n\ 12 | xdebug.remote_host=host.docker.internal' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 13 | 14 | # Grunt uses Magento 2 CLI commands. Need to install it for development 15 | RUN curl -sL https://deb.nodesource.com/setup_15.x | bash - \ 16 | && apt install nodejs -y \ 17 | && npm install -g grunt-cli 18 | 19 | # Install mhsendmail - Sendmail replacement for Mailhog 20 | RUN curl -sL https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 --output /usr/bin/mhsendmail \ 21 | && chmod +x /usr/bin/mhsendmail \ 22 | && echo 'sendmail_path="/usr/bin/mhsendmail -t --smtp-addr=mailhog:1025"' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 23 | 24 | RUN rm -r /var/lib/apt/lists/* \ 25 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/7.4/production.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.4.33-apache-bullseye 2 | 3 | # Install packages 4 | RUN apt update \ 5 | && apt upgrade -y \ 6 | && apt install -y \ 7 | cron \ 8 | curl \ 9 | git \ 10 | jq \ 11 | zip \ 12 | unzip \ 13 | libicu-dev \ 14 | libpng-dev \ 15 | libxml2-dev \ 16 | zlib1g-dev \ 17 | libxslt1-dev \ 18 | libmagickwand-dev \ 19 | librecode0 \ 20 | librecode-dev \ 21 | libzip-dev \ 22 | libsodium-dev \ 23 | --no-install-recommends 24 | 25 | RUN apt install -y memcached libmemcached-dev \ 26 | && pecl install memcached \ 27 | && docker-php-ext-enable memcached 28 | 29 | RUN pecl install imagick \ 30 | && docker-php-ext-enable imagick 31 | 32 | RUN pecl install redis \ 33 | && docker-php-ext-enable redis 34 | 35 | RUN pear install MIME_Type 36 | 37 | # Configure GD2 installation options 38 | RUN docker-php-ext-configure gd --with-freetype --with-jpeg 39 | 40 | # Install PHP Extensions 41 | RUN docker-php-ext-install bcmath gd intl mysqli opcache pcntl pdo_mysql soap sodium sockets xml xmlrpc xsl zip 42 | 43 | RUN echo 'always_populate_raw_post_data=-1\n\ 44 | memory_limit=2048M\n\ 45 | realpath_cache_size=10M\n\ 46 | realpath_cache_ttl=7200\n\ 47 | pcre.jit=0\n\ 48 | opcache.enable=1\n\ 49 | opcache.validate_timestamps=1\n\ 50 | opcache.revalidate_freq=1\n\ 51 | opcache.max_wasted_percentage=10\n\ 52 | opcache.memory_consumption=256\n\ 53 | opcache.max_accelerated_files=20000\n\ 54 | opcache.save_comments=1' > /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 55 | 56 | RUN a2enmod rewrite proxy proxy_http ssl headers expires 57 | 58 | # Must use the same UID/GUI as on the local system for the shared files to be editable on both systems 59 | RUN groupadd -g 1000 docker \ 60 | && useradd -u 1000 -g docker -m docker 61 | 62 | RUN curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer1 --1 \ 63 | && curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer2 \ 64 | && su docker -c "composer1 global require hirak/prestissimo" 65 | 66 | RUN echo '#!/bin/sh\n\ 67 | composerVersion="${COMPOSER_VERSION:-2}"\n\ 68 | # Magento requires up to 4GB RAM for `composer create-project` and `composer install` to run\n\ 69 | composerCommand="php -d memory_limit=4096M /usr/local/bin/composer${composerVersion}"\n\ 70 | $composerCommand "$@"' > /usr/local/bin/composer \ 71 | && chmod +x /usr/local/bin/composer 72 | 73 | RUN cat /usr/local/etc/php/php.ini-production > /usr/local/etc/php/php.ini 74 | 75 | RUN rm -r /var/lib/apt/lists/* \ 76 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/8.0/development.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM defaultvalue/php:8.0.30-production 2 | 3 | RUN cat /usr/local/etc/php/php.ini-development > /usr/local/etc/php/php.ini 4 | 5 | RUN pecl install xdebug-3.2.2 \ 6 | && docker-php-ext-enable xdebug \ 7 | && echo 'xdebug.mode=debug\n\ 8 | xdebug.remote_handler=dbgp\n\ 9 | xdebug.discover_client_host=0\n\ 10 | xdebug.show_error_trace=1\n\ 11 | xdebug.start_with_request=yes\n\ 12 | xdebug.max_nesting_level=256\n\ 13 | xdebug.log_level=0\n\ 14 | xdebug.client_host=host.docker.internal' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 15 | 16 | # Grunt uses Magento 2 CLI commands. Need to install it for development 17 | RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - \ 18 | && apt install nodejs -y \ 19 | && npm install -g grunt-cli \ 20 | && npm config set legacy-peer-deps=true 21 | 22 | # Install mhsendmail - Sendmail replacement for Mailhog 23 | RUN curl -sL https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 --output /usr/bin/mhsendmail \ 24 | && chmod +x /usr/bin/mhsendmail \ 25 | && echo 'sendmail_path="/usr/bin/mhsendmail -t --smtp-addr=mailhog:1025"' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 26 | 27 | RUN rm -r /var/lib/apt/lists/* \ 28 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/8.0/production.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.0.30-apache-bullseye 2 | 3 | # Install packages 4 | RUN apt update \ 5 | && apt upgrade -y \ 6 | && apt install -y \ 7 | cron \ 8 | git \ 9 | jq \ 10 | lsof \ 11 | zip \ 12 | unzip \ 13 | libmagickwand-dev \ 14 | libicu-dev \ 15 | libjpeg-dev \ 16 | libpng-dev \ 17 | libfreetype-dev \ 18 | libxml2-dev \ 19 | libxslt1-dev \ 20 | libzip-dev \ 21 | zlib1g-dev \ 22 | --no-install-recommends 23 | 24 | RUN pecl install imagick \ 25 | && docker-php-ext-enable imagick 26 | 27 | RUN pecl install redis \ 28 | && docker-php-ext-enable redis 29 | 30 | # Configure GD2 installation options 31 | RUN docker-php-ext-configure gd --with-freetype --with-jpeg 32 | 33 | # Install PHP Extensions 34 | RUN docker-php-ext-install bcmath gd intl mysqli opcache pcntl pdo_mysql soap sockets xsl xmlwriter zip 35 | 36 | RUN echo 'always_populate_raw_post_data=-1\n\ 37 | memory_limit=2048M\n\ 38 | realpath_cache_size=10M\n\ 39 | realpath_cache_ttl=7200\n\ 40 | pcre.jit=0\n\ 41 | opcache.enable=1\n\ 42 | opcache.validate_timestamps=1\n\ 43 | opcache.revalidate_freq=1\n\ 44 | opcache.max_wasted_percentage=10\n\ 45 | opcache.memory_consumption=256\n\ 46 | opcache.max_accelerated_files=20000' > /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 47 | 48 | RUN a2enmod rewrite proxy proxy_http ssl headers expires 49 | 50 | # Must use the same UID/GUI as on the local system for the shared files to be editable on both systems 51 | RUN groupadd -g 1000 docker \ 52 | && useradd -u 1000 -g docker -m docker 53 | 54 | RUN curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer1 --1 \ 55 | && curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer2 56 | 57 | RUN echo '#!/bin/sh\n\ 58 | composerVersion="${COMPOSER_VERSION:-2}"\n\ 59 | # Magento requires up to 4GB RAM for `composer create-project` and `composer install` to run\n\ 60 | composerCommand="php -d memory_limit=4096M /usr/local/bin/composer${composerVersion}"\n\ 61 | $composerCommand "$@"' > /usr/local/bin/composer \ 62 | && chmod +x /usr/local/bin/composer 63 | 64 | RUN cat /usr/local/etc/php/php.ini-production > /usr/local/etc/php/php.ini 65 | 66 | RUN rm -r /var/lib/apt/lists/* \ 67 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/8.1/development.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM defaultvalue/php:8.1.27-production 2 | 3 | RUN cat /usr/local/etc/php/php.ini-development > /usr/local/etc/php/php.ini 4 | 5 | RUN pecl install xdebug-3.2.2 \ 6 | && docker-php-ext-enable xdebug \ 7 | && echo 'xdebug.mode=debug\n\ 8 | xdebug.remote_handler=dbgp\n\ 9 | xdebug.discover_client_host=0\n\ 10 | xdebug.show_error_trace=1\n\ 11 | xdebug.start_with_request=yes\n\ 12 | xdebug.max_nesting_level=256\n\ 13 | xdebug.log_level=0\n\ 14 | xdebug.client_host=host.docker.internal' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 15 | 16 | # Grunt uses Magento 2 CLI commands. Need to install it for development 17 | RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - \ 18 | && apt install nodejs -y \ 19 | && npm install -g grunt-cli \ 20 | && npm config set legacy-peer-deps=true 21 | 22 | # Install mhsendmail - Sendmail replacement for Mailhog 23 | RUN curl -sL https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 --output /usr/bin/mhsendmail \ 24 | && chmod +x /usr/bin/mhsendmail \ 25 | && echo 'sendmail_path="/usr/bin/mhsendmail -t --smtp-addr=mailhog:1025"' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 26 | 27 | RUN rm -r /var/lib/apt/lists/* \ 28 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/8.1/production.Dockerfile: -------------------------------------------------------------------------------- 1 | # Based on Debian 11 (bullseye) in order to keep NodeJS 16. Otherwise NodeJS 18 would be installed for some reason. 2 | FROM php:8.1.27-apache-bullseye 3 | 4 | # Install packages 5 | RUN apt update \ 6 | && apt upgrade -y \ 7 | && apt install -y \ 8 | cron \ 9 | git \ 10 | jq \ 11 | lsof \ 12 | zip \ 13 | unzip \ 14 | libmagickwand-dev \ 15 | libicu-dev \ 16 | libjpeg-dev \ 17 | libpng-dev \ 18 | libfreetype-dev \ 19 | libxml2-dev \ 20 | libxslt1-dev \ 21 | libzip-dev \ 22 | zlib1g-dev \ 23 | --no-install-recommends 24 | 25 | RUN pecl install imagick \ 26 | && docker-php-ext-enable imagick 27 | 28 | RUN pecl install redis \ 29 | && docker-php-ext-enable redis 30 | 31 | # Configure GD2 installation options 32 | RUN docker-php-ext-configure gd --with-freetype --with-jpeg 33 | 34 | # Install PHP Extensions 35 | RUN docker-php-ext-install bcmath gd intl mysqli opcache pcntl pdo_mysql soap sockets xsl xmlwriter zip 36 | 37 | RUN echo 'always_populate_raw_post_data=-1\n\ 38 | memory_limit=2048M\n\ 39 | realpath_cache_size=10M\n\ 40 | realpath_cache_ttl=7200\n\ 41 | pcre.jit=0\n\ 42 | opcache.enable=1\n\ 43 | opcache.validate_timestamps=1\n\ 44 | opcache.revalidate_freq=1\n\ 45 | opcache.max_wasted_percentage=10\n\ 46 | opcache.memory_consumption=256\n\ 47 | opcache.max_accelerated_files=20000' > /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 48 | 49 | RUN a2enmod rewrite proxy proxy_http ssl headers expires 50 | 51 | # Must use the same UID/GUI as on the local system for the shared files to be editable on both systems 52 | RUN groupadd -g 1000 docker \ 53 | && useradd -u 1000 -g docker -m docker 54 | 55 | RUN curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer1 --1 \ 56 | && curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer2 57 | 58 | RUN echo '#!/bin/sh\n\ 59 | composerVersion="${COMPOSER_VERSION:-2}"\n\ 60 | # Magento requires up to 4GB RAM for `composer create-project` and `composer install` to run\n\ 61 | composerCommand="php -d memory_limit=4096M /usr/local/bin/composer${composerVersion}"\n\ 62 | $composerCommand "$@"' > /usr/local/bin/composer \ 63 | && chmod +x /usr/local/bin/composer 64 | 65 | RUN cat /usr/local/etc/php/php.ini-production > /usr/local/etc/php/php.ini 66 | 67 | RUN rm -r /var/lib/apt/lists/* \ 68 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/8.2/development.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM defaultvalue/php:8.2.18-production 2 | 3 | RUN cat /usr/local/etc/php/php.ini-development > /usr/local/etc/php/php.ini 4 | 5 | RUN pecl install xdebug-3.2.2 \ 6 | && docker-php-ext-enable xdebug \ 7 | && echo 'xdebug.mode=debug\n\ 8 | xdebug.remote_handler=dbgp\n\ 9 | xdebug.discover_client_host=0\n\ 10 | xdebug.show_error_trace=1\n\ 11 | xdebug.start_with_request=yes\n\ 12 | xdebug.max_nesting_level=256\n\ 13 | xdebug.log_level=0\n\ 14 | xdebug.client_host=host.docker.internal' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 15 | 16 | # Grunt uses Magento 2 CLI commands. Need to install it for development 17 | RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - \ 18 | && apt install nodejs -y \ 19 | && npm install -g grunt-cli \ 20 | && npm config set legacy-peer-deps=true 21 | 22 | # Install mhsendmail - Sendmail replacement for Mailhog 23 | RUN curl -sL https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 --output /usr/bin/mhsendmail \ 24 | && chmod +x /usr/bin/mhsendmail \ 25 | && echo 'sendmail_path="/usr/bin/mhsendmail -t --smtp-addr=mailhog:1025"' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 26 | 27 | RUN rm -r /var/lib/apt/lists/* \ 28 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/8.2/production.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.2.18-apache-bookworm 2 | 3 | # Install packages 4 | RUN apt update \ 5 | && apt upgrade -y \ 6 | && apt install -y \ 7 | cron \ 8 | git \ 9 | jq \ 10 | lsof \ 11 | zip \ 12 | unzip \ 13 | libmagickwand-dev \ 14 | libicu-dev \ 15 | libjpeg-dev \ 16 | libpng-dev \ 17 | libfreetype-dev \ 18 | libxml2-dev \ 19 | libxslt1-dev \ 20 | libzip-dev \ 21 | zlib1g-dev \ 22 | --no-install-recommends 23 | 24 | RUN pecl install imagick \ 25 | && docker-php-ext-enable imagick 26 | 27 | RUN pecl install redis \ 28 | && docker-php-ext-enable redis 29 | 30 | # Configure GD2 installation options 31 | RUN docker-php-ext-configure gd --with-freetype --with-jpeg 32 | 33 | # Install PHP Extensions 34 | RUN docker-php-ext-install bcmath gd intl mysqli opcache pcntl pdo_mysql soap sockets xsl xmlwriter zip 35 | 36 | RUN echo 'always_populate_raw_post_data=-1\n\ 37 | memory_limit=2048M\n\ 38 | realpath_cache_size=10M\n\ 39 | realpath_cache_ttl=7200\n\ 40 | pcre.jit=0\n\ 41 | opcache.enable=1\n\ 42 | opcache.validate_timestamps=1\n\ 43 | opcache.revalidate_freq=1\n\ 44 | opcache.max_wasted_percentage=10\n\ 45 | opcache.memory_consumption=256\n\ 46 | opcache.max_accelerated_files=20000' > /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 47 | 48 | RUN a2enmod rewrite proxy proxy_http ssl headers expires 49 | 50 | # Must use the same UID/GUI as on the local system for the shared files to be editable on both systems 51 | RUN groupadd -g 1000 docker \ 52 | && useradd -u 1000 -g docker -m docker 53 | 54 | RUN curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer1 --1 \ 55 | && curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer2 56 | 57 | RUN echo '#!/bin/sh\n\ 58 | composerVersion="${COMPOSER_VERSION:-2}"\n\ 59 | # Magento requires up to 4GB RAM for `composer create-project` and `composer install` to run\n\ 60 | composerCommand="php -d memory_limit=4096M /usr/local/bin/composer${composerVersion}"\n\ 61 | $composerCommand "$@"' > /usr/local/bin/composer \ 62 | && chmod +x /usr/local/bin/composer 63 | 64 | RUN cat /usr/local/etc/php/php.ini-production > /usr/local/etc/php/php.ini 65 | 66 | RUN rm -r /var/lib/apt/lists/* \ 67 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/8.3/development.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM defaultvalue/php:8.3.17-production 2 | 3 | RUN cat /usr/local/etc/php/php.ini-development > /usr/local/etc/php/php.ini 4 | 5 | RUN pecl install xdebug-3.3.1 \ 6 | && docker-php-ext-enable xdebug \ 7 | && echo 'xdebug.mode=debug\n\ 8 | xdebug.remote_handler=dbgp\n\ 9 | xdebug.discover_client_host=0\n\ 10 | xdebug.show_error_trace=1\n\ 11 | xdebug.start_with_request=yes\n\ 12 | xdebug.max_nesting_level=256\n\ 13 | xdebug.log_level=0\n\ 14 | xdebug.client_host=host.docker.internal' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 15 | 16 | # Grunt uses Magento 2 CLI commands. Need to install it for development 17 | # https://github.com/nodesource/distributions?tab=readme-ov-file#nodejs 18 | RUN apt-get update \ 19 | && apt install -y ca-certificates curl gnupg \ 20 | && mkdir -p /etc/apt/keyrings \ 21 | && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ 22 | && NODE_MAJOR=20 \ 23 | && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \ 24 | && apt update \ 25 | && apt install nodejs -y \ 26 | && npm install -g grunt-cli \ 27 | && npm config set legacy-peer-deps=true 28 | 29 | # Install mhsendmail - Sendmail replacement for Mailhog 30 | RUN curl -sL https://github.com/devilbox/mhsendmail/releases/download/v0.3.0/mhsendmail_linux_amd64 --output /usr/bin/mhsendmail \ 31 | && chmod +x /usr/bin/mhsendmail \ 32 | && echo 'sendmail_path="/usr/bin/mhsendmail -t --smtp-addr=mailhog:1025"' >> /usr/local/etc/php/conf.d/docker-php-xxx-custom.ini 33 | 34 | RUN rm -r /var/lib/apt/lists/* \ 35 | && rm -rf /tmp/pear/ -------------------------------------------------------------------------------- /templates/php/8.3/production.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3.17-apache-bookworm 2 | 3 | # Install packages 4 | RUN apt update \ 5 | && apt upgrade -y \ 6 | && apt install -y \ 7 | cron \ 8 | git \ 9 | jq \ 10 | lsof \ 11 | zip \ 12 | unzip \ 13 | libmagickwand-dev \ 14 | libicu-dev \ 15 | libjpeg-dev \ 16 | libpng-dev \ 17 | libfreetype-dev \ 18 | libxml2-dev \ 19 | libxslt1-dev \ 20 | libzip-dev \ 21 | zlib1g-dev \ 22 | librabbitmq-dev \ 23 | libssl-dev \ 24 | --no-install-recommends 25 | 26 | # https://github.com/Imagick/imagick/pull/641 27 | #RUN pecl install imagick \ 28 | # && docker-php-ext-enable imagick 29 | 30 | RUN pecl install redis \ 31 | && docker-php-ext-enable redis 32 | 33 | RUN pecl install amqp \ 34 | && docker-php-ext-enable amqp 35 | 36 | # Configure GD2 installation options 37 | RUN docker-php-ext-configure gd --with-freetype --with-jpeg 38 | 39 | # Install PHP Extensions 40 | RUN docker-php-ext-install bcmath gd intl mysqli opcache pcntl pdo_mysql soap sockets xsl zip 41 | 42 | RUN echo 'date.timezone=UTC\n\ 43 | always_populate_raw_post_data=-1\n\ 44 | memory_limit=2048M\n\ 45 | realpath_cache_size=10M\n\ 46 | realpath_cache_ttl=7200\n\ 47 | opcache.enable=1\n\ 48 | opcache.validate_timestamps=1\n\ 49 | opcache.revalidate_freq=1\n\ 50 | opcache.max_wasted_percentage=10\n\ 51 | opcache.memory_consumption=256\n\ 52 | opcache.max_accelerated_files=20000\n\ 53 | amqp.connection_timeout=3\n\ 54 | amqp.read_timeout=3\n\ 55 | amqp.write_timeout=3\n\ 56 | amqp.heartbeat=2' > "$PHP_INI_DIR/conf.d/docker-php-zzz-custom.ini" 57 | 58 | RUN a2enmod rewrite proxy proxy_http ssl headers expires 59 | 60 | # Must use the same UID/GUI as on the local system for the shared files to be editable on both systems 61 | RUN groupadd -g 1000 docker \ 62 | && useradd -u 1000 -g docker -m docker 63 | 64 | RUN curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ 65 | && chmod +x /usr/local/bin/composer 66 | 67 | RUN cat /usr/local/etc/php/php.ini-production > /usr/local/etc/php/php.ini 68 | 69 | RUN rm -r /var/lib/apt/lists/* \ 70 | && rm -rf /tmp/pear/ --------------------------------------------------------------------------------