├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── bin └── .travis │ ├── build.sh │ ├── push.sh │ ├── test.sh │ └── update_docker.sh └── php ├── Dockerfile-7.1 ├── Dockerfile-7.2 ├── Dockerfile-7.3 ├── Dockerfile-7.4 ├── Dockerfile-8.0 ├── Dockerfile-8.1 ├── Dockerfile-node10 ├── Dockerfile-node12 ├── Dockerfile-node14 ├── Dockerfile-node16 ├── conf.d ├── blackfire.ini ├── php.ini ├── xdebug.ini └── xdebug2.ini └── scripts ├── docker-entrypoint.sh └── wait_for_db.php /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | volumes 3 | 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: focal 2 | language: php 3 | php: 4 | - 7.4 5 | 6 | services: 7 | - docker 8 | 9 | cache: 10 | directories: 11 | - $HOME/.composer/cache 12 | 13 | env: 14 | global: 15 | - REMOTE_IMAGE="ezsystems/php" 16 | - LATEST_PHP="7.3" 17 | - LATEST_NODE="12" 18 | - FORMAT_VERSION="v2" 19 | - TEST_CMD="vendor/bin/behat -v --profile=browser --suite=admin-ui --tags=@richtext --config=behat_ibexa_oss.yaml" 20 | matrix: 21 | # Run per Dockerfile-- 22 | - PHP_VERSION="7.1" NODE_VERSION="10" PRODUCT_VERSION="^2.5" TEST_CMD="bin/behat -v --profile=adminui --suite=richtext" 23 | - PHP_VERSION="7.1" NODE_VERSION="12" PRODUCT_VERSION="^2.5" TEST_CMD="bin/behat -v --profile=adminui --suite=richtext" 24 | - PHP_VERSION="7.1" NODE_VERSION="14" PRODUCT_VERSION="^2.5" TEST_CMD="bin/behat -v --profile=adminui --suite=richtext" 25 | - PHP_VERSION="7.2" NODE_VERSION="10" PRODUCT_VERSION="^2.5" TEST_CMD="bin/behat -v --profile=adminui --suite=richtext" 26 | - PHP_VERSION="7.2" NODE_VERSION="12" PRODUCT_VERSION="^2.5" TEST_CMD="bin/behat -v --profile=adminui --suite=richtext" 27 | - PHP_VERSION="7.2" NODE_VERSION="14" PRODUCT_VERSION="^2.5" TEST_CMD="bin/behat -v --profile=adminui --suite=richtext" 28 | - PHP_VERSION="7.3" NODE_VERSION="10" PRODUCT_VERSION="^2.5" TEST_CMD="bin/behat -v --profile=adminui --suite=richtext" 29 | - PHP_VERSION="7.3" NODE_VERSION="12" 30 | - PHP_VERSION="7.3" NODE_VERSION="14" 31 | - PHP_VERSION="7.4" NODE_VERSION="10" PRODUCT_VERSION="^2.5" TEST_CMD="bin/behat -v --profile=adminui --suite=richtext" 32 | - PHP_VERSION="7.4" NODE_VERSION="12" 33 | - PHP_VERSION="7.4" NODE_VERSION="14" 34 | - PHP_VERSION="7.4" NODE_VERSION="16" 35 | - PHP_VERSION="8.0" NODE_VERSION="12" COMPOSER_OPTIONS="--ignore-platform-req=php" 36 | - PHP_VERSION="8.0" NODE_VERSION="14" COMPOSER_OPTIONS="--ignore-platform-req=php" 37 | - PHP_VERSION="8.0" NODE_VERSION="16" COMPOSER_OPTIONS="--ignore-platform-req=php" 38 | - PHP_VERSION="8.1" NODE_VERSION="12" COMPOSER_OPTIONS="--ignore-platform-req=php" 39 | - PHP_VERSION="8.1" NODE_VERSION="14" COMPOSER_OPTIONS="--ignore-platform-req=php" 40 | - PHP_VERSION="8.1" NODE_VERSION="16" COMPOSER_OPTIONS="--ignore-platform-req=php" 41 | 42 | 43 | before_script: 44 | - export COMPOSER_HOME=$(composer config --global home) 45 | - if [[ -n "${DOCKER_PASSWORD_TEST}" ]]; then echo ${DOCKER_PASSWORD_TEST} | docker login -u ${DOCKER_USERNAME_TEST} --password-stdin ; fi 46 | - echo "{\"github-oauth\":{\"github.com\":\"d0285ed5c8644f30547572ead2ed897431c1fc09\"}}" > ~/.composer/auth.json 47 | - if [ "$GITHUB_TOKEN" != "" ] ; then composer global config github-oauth.github.com $GITHUB_TOKEN ; fi 48 | - bin/.travis/update_docker.sh 49 | - bin/.travis/build.sh ${PHP_VERSION} ${NODE_VERSION} 50 | script: bin/.travis/test.sh 51 | after_failure: if [ -d volumes/ezplatform ]; then cd volumes/ezplatform; docker-compose logs; fi 52 | 53 | after_success: 54 | - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit 0; fi 55 | - if [ "$TRAVIS_BRANCH" = "master" ] || [ "$TRAVIS_BRANCH" = "v1" ]; then bin/.travis/push.sh ${REMOTE_IMAGE} ${FORMAT_VERSION}; fi 56 | 57 | # test only master (+ Pull requests) 58 | branches: 59 | only: 60 | - master 61 | - /^v\d$/ 62 | - /^v\d.\d.\d$/ 63 | 64 | # disable mail notifications 65 | notifications: 66 | email: false 67 | 68 | # reduce depth (history) of git checkout 69 | git: 70 | depth: 30 71 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 1999-2016 eZ Systems AS. All rights reserved. 2 | This source code is provided under the following license: 3 | 4 | 5 | GNU GENERAL PUBLIC LICENSE 6 | Version 2, June 1991 7 | 8 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 9 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 10 | Everyone is permitted to copy and distribute verbatim copies 11 | of this license document, but changing it is not allowed. 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | License is intended to guarantee your freedom to share and change free 18 | software--to make sure the software is free for all its users. This 19 | General Public License applies to most of the Free Software 20 | Foundation's software and to any other program whose authors commit to 21 | using it. (Some other Free Software Foundation software is covered by 22 | the GNU Lesser General Public License instead.) You can apply it to 23 | your programs, too. 24 | 25 | When we speak of free software, we are referring to freedom, not 26 | price. Our General Public Licenses are designed to make sure that you 27 | have the freedom to distribute copies of free software (and charge for 28 | this service if you wish), that you receive source code or can get it 29 | if you want it, that you can change the software or use pieces of it 30 | in new free programs; and that you know you can do these things. 31 | 32 | To protect your rights, we need to make restrictions that forbid 33 | anyone to deny you these rights or to ask you to surrender the rights. 34 | These restrictions translate to certain responsibilities for you if you 35 | distribute copies of the software, or if you modify it. 36 | 37 | For example, if you distribute copies of such a program, whether 38 | gratis or for a fee, you must give the recipients all the rights that 39 | you have. You must make sure that they, too, receive or can get the 40 | source code. And you must show them these terms so they know their 41 | rights. 42 | 43 | We protect your rights with two steps: (1) copyright the software, and 44 | (2) offer you this license which gives you legal permission to copy, 45 | distribute and/or modify the software. 46 | 47 | Also, for each author's protection and ours, we want to make certain 48 | that everyone understands that there is no warranty for this free 49 | software. If the software is modified by someone else and passed on, we 50 | want its recipients to know that what they have is not the original, so 51 | that any problems introduced by others will not reflect on the original 52 | authors' reputations. 53 | 54 | Finally, any free program is threatened constantly by software 55 | patents. We wish to avoid the danger that redistributors of a free 56 | program will individually obtain patent licenses, in effect making the 57 | program proprietary. To prevent this, we have made it clear that any 58 | patent must be licensed for everyone's free use or not licensed at all. 59 | 60 | The precise terms and conditions for copying, distribution and 61 | modification follow. 62 | 63 | GNU GENERAL PUBLIC LICENSE 64 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 65 | 66 | 0. This License applies to any program or other work which contains 67 | a notice placed by the copyright holder saying it may be distributed 68 | under the terms of this General Public License. The "Program", below, 69 | refers to any such program or work, and a "work based on the Program" 70 | means either the Program or any derivative work under copyright law: 71 | that is to say, a work containing the Program or a portion of it, 72 | either verbatim or with modifications and/or translated into another 73 | language. (Hereinafter, translation is included without limitation in 74 | the term "modification".) Each licensee is addressed as "you". 75 | 76 | Activities other than copying, distribution and modification are not 77 | covered by this License; they are outside its scope. The act of 78 | running the Program is not restricted, and the output from the Program 79 | is covered only if its contents constitute a work based on the 80 | Program (independent of having been made by running the Program). 81 | Whether that is true depends on what the Program does. 82 | 83 | 1. You may copy and distribute verbatim copies of the Program's 84 | source code as you receive it, in any medium, provided that you 85 | conspicuously and appropriately publish on each copy an appropriate 86 | copyright notice and disclaimer of warranty; keep intact all the 87 | notices that refer to this License and to the absence of any warranty; 88 | and give any other recipients of the Program a copy of this License 89 | along with the Program. 90 | 91 | You may charge a fee for the physical act of transferring a copy, and 92 | you may at your option offer warranty protection in exchange for a fee. 93 | 94 | 2. You may modify your copy or copies of the Program or any portion 95 | of it, thus forming a work based on the Program, and copy and 96 | distribute such modifications or work under the terms of Section 1 97 | above, provided that you also meet all of these conditions: 98 | 99 | a) You must cause the modified files to carry prominent notices 100 | stating that you changed the files and the date of any change. 101 | 102 | b) You must cause any work that you distribute or publish, that in 103 | whole or in part contains or is derived from the Program or any 104 | part thereof, to be licensed as a whole at no charge to all third 105 | parties under the terms of this License. 106 | 107 | c) If the modified program normally reads commands interactively 108 | when run, you must cause it, when started running for such 109 | interactive use in the most ordinary way, to print or display an 110 | announcement including an appropriate copyright notice and a 111 | notice that there is no warranty (or else, saying that you provide 112 | a warranty) and that users may redistribute the program under 113 | these conditions, and telling the user how to view a copy of this 114 | License. (Exception: if the Program itself is interactive but 115 | does not normally print such an announcement, your work based on 116 | the Program is not required to print an announcement.) 117 | 118 | These requirements apply to the modified work as a whole. If 119 | identifiable sections of that work are not derived from the Program, 120 | and can be reasonably considered independent and separate works in 121 | themselves, then this License, and its terms, do not apply to those 122 | sections when you distribute them as separate works. But when you 123 | distribute the same sections as part of a whole which is a work based 124 | on the Program, the distribution of the whole must be on the terms of 125 | this License, whose permissions for other licensees extend to the 126 | entire whole, and thus to each and every part regardless of who wrote it. 127 | 128 | Thus, it is not the intent of this section to claim rights or contest 129 | your rights to work written entirely by you; rather, the intent is to 130 | exercise the right to control the distribution of derivative or 131 | collective works based on the Program. 132 | 133 | In addition, mere aggregation of another work not based on the Program 134 | with the Program (or with a work based on the Program) on a volume of 135 | a storage or distribution medium does not bring the other work under 136 | the scope of this License. 137 | 138 | 3. You may copy and distribute the Program (or a work based on it, 139 | under Section 2) in object code or executable form under the terms of 140 | Sections 1 and 2 above provided that you also do one of the following: 141 | 142 | a) Accompany it with the complete corresponding machine-readable 143 | source code, which must be distributed under the terms of Sections 144 | 1 and 2 above on a medium customarily used for software interchange; or, 145 | 146 | b) Accompany it with a written offer, valid for at least three 147 | years, to give any third party, for a charge no more than your 148 | cost of physically performing source distribution, a complete 149 | machine-readable copy of the corresponding source code, to be 150 | distributed under the terms of Sections 1 and 2 above on a medium 151 | customarily used for software interchange; or, 152 | 153 | c) Accompany it with the information you received as to the offer 154 | to distribute corresponding source code. (This alternative is 155 | allowed only for noncommercial distribution and only if you 156 | received the program in object code or executable form with such 157 | an offer, in accord with Subsection b above.) 158 | 159 | The source code for a work means the preferred form of the work for 160 | making modifications to it. For an executable work, complete source 161 | code means all the source code for all modules it contains, plus any 162 | associated interface definition files, plus the scripts used to 163 | control compilation and installation of the executable. However, as a 164 | special exception, the source code distributed need not include 165 | anything that is normally distributed (in either source or binary 166 | form) with the major components (compiler, kernel, and so on) of the 167 | operating system on which the executable runs, unless that component 168 | itself accompanies the executable. 169 | 170 | If distribution of executable or object code is made by offering 171 | access to copy from a designated place, then offering equivalent 172 | access to copy the source code from the same place counts as 173 | distribution of the source code, even though third parties are not 174 | compelled to copy the source along with the object code. 175 | 176 | 4. You may not copy, modify, sublicense, or distribute the Program 177 | except as expressly provided under this License. Any attempt 178 | otherwise to copy, modify, sublicense or distribute the Program is 179 | void, and will automatically terminate your rights under this License. 180 | However, parties who have received copies, or rights, from you under 181 | this License will not have their licenses terminated so long as such 182 | parties remain in full compliance. 183 | 184 | 5. You are not required to accept this License, since you have not 185 | signed it. However, nothing else grants you permission to modify or 186 | distribute the Program or its derivative works. These actions are 187 | prohibited by law if you do not accept this License. Therefore, by 188 | modifying or distributing the Program (or any work based on the 189 | Program), you indicate your acceptance of this License to do so, and 190 | all its terms and conditions for copying, distributing or modifying 191 | the Program or works based on it. 192 | 193 | 6. Each time you redistribute the Program (or any work based on the 194 | Program), the recipient automatically receives a license from the 195 | original licensor to copy, distribute or modify the Program subject to 196 | these terms and conditions. You may not impose any further 197 | restrictions on the recipients' exercise of the rights granted herein. 198 | You are not responsible for enforcing compliance by third parties to 199 | this License. 200 | 201 | 7. If, as a consequence of a court judgment or allegation of patent 202 | infringement or for any other reason (not limited to patent issues), 203 | conditions are imposed on you (whether by court order, agreement or 204 | otherwise) that contradict the conditions of this License, they do not 205 | excuse you from the conditions of this License. If you cannot 206 | distribute so as to satisfy simultaneously your obligations under this 207 | License and any other pertinent obligations, then as a consequence you 208 | may not distribute the Program at all. For example, if a patent 209 | license would not permit royalty-free redistribution of the Program by 210 | all those who receive copies directly or indirectly through you, then 211 | the only way you could satisfy both it and this License would be to 212 | refrain entirely from distribution of the Program. 213 | 214 | If any portion of this section is held invalid or unenforceable under 215 | any particular circumstance, the balance of the section is intended to 216 | apply and the section as a whole is intended to apply in other 217 | circumstances. 218 | 219 | It is not the purpose of this section to induce you to infringe any 220 | patents or other property right claims or to contest validity of any 221 | such claims; this section has the sole purpose of protecting the 222 | integrity of the free software distribution system, which is 223 | implemented by public license practices. Many people have made 224 | generous contributions to the wide range of software distributed 225 | through that system in reliance on consistent application of that 226 | system; it is up to the author/donor to decide if he or she is willing 227 | to distribute software through any other system and a licensee cannot 228 | impose that choice. 229 | 230 | This section is intended to make thoroughly clear what is believed to 231 | be a consequence of the rest of this License. 232 | 233 | 8. If the distribution and/or use of the Program is restricted in 234 | certain countries either by patents or by copyrighted interfaces, the 235 | original copyright holder who places the Program under this License 236 | may add an explicit geographical distribution limitation excluding 237 | those countries, so that distribution is permitted only in or among 238 | countries not thus excluded. In such case, this License incorporates 239 | the limitation as if written in the body of this License. 240 | 241 | 9. The Free Software Foundation may publish revised and/or new versions 242 | of the General Public License from time to time. Such new versions will 243 | be similar in spirit to the present version, but may differ in detail to 244 | address new problems or concerns. 245 | 246 | Each version is given a distinguishing version number. If the Program 247 | specifies a version number of this License which applies to it and "any 248 | later version", you have the option of following the terms and conditions 249 | either of that version or of any later version published by the Free 250 | Software Foundation. If the Program does not specify a version number of 251 | this License, you may choose any version ever published by the Free Software 252 | Foundation. 253 | 254 | 10. If you wish to incorporate parts of the Program into other free 255 | programs whose distribution conditions are different, write to the author 256 | to ask for permission. For software which is copyrighted by the Free 257 | Software Foundation, write to the Free Software Foundation; we sometimes 258 | make exceptions for this. Our decision will be guided by the two goals 259 | of preserving the free status of all derivatives of our free software and 260 | of promoting the sharing and reuse of software generally. 261 | 262 | NO WARRANTY 263 | 264 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 265 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 266 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 267 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 268 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 269 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 270 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 271 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 272 | REPAIR OR CORRECTION. 273 | 274 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 275 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 276 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 277 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 278 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 279 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 280 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 281 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 282 | POSSIBILITY OF SUCH DAMAGES. 283 | 284 | END OF TERMS AND CONDITIONS 285 | 286 | How to Apply These Terms to Your New Programs 287 | 288 | If you develop a new program, and you want it to be of the greatest 289 | possible use to the public, the best way to achieve this is to make it 290 | free software which everyone can redistribute and change under these terms. 291 | 292 | To do so, attach the following notices to the program. It is safest 293 | to attach them to the start of each source file to most effectively 294 | convey the exclusion of warranty; and each file should have at least 295 | the "copyright" line and a pointer to where the full notice is found. 296 | 297 | {description} 298 | Copyright (C) {year} {fullname} 299 | 300 | This program is free software; you can redistribute it and/or modify 301 | it under the terms of the GNU General Public License as published by 302 | the Free Software Foundation; either version 2 of the License, or 303 | (at your option) any later version. 304 | 305 | This program is distributed in the hope that it will be useful, 306 | but WITHOUT ANY WARRANTY; without even the implied warranty of 307 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 308 | GNU General Public License for more details. 309 | 310 | You should have received a copy of the GNU General Public License along 311 | with this program; if not, write to the Free Software Foundation, Inc., 312 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 313 | 314 | Also add information on how to contact you by electronic and paper mail. 315 | 316 | If the program is interactive, make it output a short notice like this 317 | when it starts in an interactive mode: 318 | 319 | Gnomovision version 69, Copyright (C) year name of author 320 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 321 | This is free software, and you are welcome to redistribute it 322 | under certain conditions; type `show c' for details. 323 | 324 | The hypothetical commands `show w' and `show c' should show the appropriate 325 | parts of the General Public License. Of course, the commands you use may 326 | be called something other than `show w' and `show c'; they could even be 327 | mouse-clicks or menu items--whatever suits your program. 328 | 329 | You should also get your employer (if you work as a programmer) or your 330 | school, if any, to sign a "copyright disclaimer" for the program, if 331 | necessary. Here is a sample; alter the names: 332 | 333 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 334 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 335 | 336 | {signature of Ty Coon}, 1 April 1989 337 | Ty Coon, President of Vice 338 | 339 | This General Public License does not permit incorporating your program into 340 | proprietary programs. If your program is a subroutine library, you may 341 | consider it more useful to permit linking proprietary applications with the 342 | library. If this is what you want to do, use the GNU Lesser General 343 | Public License instead of this License. 344 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Example of PHP Docker image for use with eZ Platform 2 | 3 | > **Example/Internal**: Instructions and Tools in this repository is provided as an example, which you can take and customize to your needs if you want to. This is something we use activly internally for QA and Demo use, and thus might change without notice _(we version the images, but only latests version receives updates)_. 4 | > 5 | > If you are looking to have a ready made Docker environment for local development see [eZ Launchpad](https://ezsystems.github.io/launchpad/) which is supported/provided by the comunity. 6 | > 7 | > If you are looking for ready made, optimized, development and production hosted environment see [eZ Platform Cloud](https://ez.no/Blog/We-Are-Launching-eZ-Platform-Cloud-Speeding-Up-Development-of-Your-Projects) 8 | 9 | 10 | This Git repository contains source code for eZ Systems provided Docker PHP images [available on Docker Hub](https://hub.docker.com/r/ezsystems/php/). 11 | 12 | The Docker images here extends [official PHP images](https://hub.docker.com/_/php/) and includes php-cli, php-fpm, [composer](https://getcomposer.org/), [blackfire](https://blackfire.io/), tweaks and extensions for optimal use with any advance Symfony applications *(like eZ Platform and eZ Platform EE)*. 13 | 14 | _NOTE: The images here, just like the official once they extend, are meant to follow Dockers 1 main process per container recommendation from Docker, adding additional services to the image is not recommended and probably won't work. If so start from scratch with something else instead of using this._ 15 | 16 | 17 | ## Overview 18 | 19 | PHP image that aims to technically support running: 20 | - eZ Platform/Platform Enterprise *(1.13.4 or higher)* 21 | - Symfony *(As in any symfony-standard like app that have same or less requirements then eZ Platform)* 22 | 23 | The v1 format images are meant for eZ Platform v1, for images that can be used with eZ Platform v2 and v3 look at the v2 format. 24 | 25 | ## Images 26 | 27 | This repository contains several images for different versions of PHP\*: 28 | - Extends `php:x.y-fpm` _(uses `debian:stretch-slim` unless otherwise noted)_: 29 | - [7.4](php/Dockerfile-7.4) *(uses `debian:buster-slim`)* 30 | - [7.3](php/Dockerfile-7.3) 31 | - [7.2](php/Dockerfile-7.2) *(Security fixes only)* 32 | - [7.1](php/Dockerfile-7.1) *(End of life December 2019, move to newer or use LTS packages from a Linux distro instead)* 33 | - [7.0](php/Dockerfile-7.0) *(End of life January 2019, move to newer or use LTS packages from a Linux distro instead)* 34 | - [5.6](php/Dockerfile-5.6) *(End of life December 2018, move to newer or use LTS packages from a Linux distro instead)* 35 | 36 | _Recommended version for testing newest versions of eZ Platform is PHP 7.3 or 7.4 for best performance._ 37 | 38 | \* *Primarily: Since this is also used to run functional testing against several PHP versions, for any other usage use the recommended image.* 39 | 40 | ## Node image 41 | 42 | For each php version there is an additional `-node` flavour with Node.js (Node 10 LTS) and Yarn installed, useful if your project needs it (for example for Webpack Encore). 43 | 44 | ### Dev image 45 | 46 | For each php version there is an additional `-dev` flavour based on Node image, with additional tools for when you need to be able to login and work towards the installation. It contains tools like vim, git, xdebug, ... [and others](php/Dockerfile-dev). 47 | 48 | Tip: To customize Xdebug configuration you can use `XDEBUG_CONFIG` environment variable, check *Using an environment* variable section in [Xdebug](https://xdebug.org/docs/remote) documentation. 49 | 50 | ### Format version 51 | 52 | To be able to improve the image in the future, we have added a format version number that we will increase on future changes *(for instance move to Alpine Linux)*. 53 | 54 | It is recommended to specify a tag with this format version number in your Docker / docker-compose use to avoid breaks in your application. 55 | 56 | 57 | ## Usage 58 | 59 | This image has been made so it can be used directly for development and built with your application for production use, this 60 | allows you to use the same image across all whole DevOps life cycle *(dev, build, testing, staging and production)*. 61 | 62 | Before you start, you can test the image to see if you get which php version it is running: 63 | ```bash 64 | docker run --rm ezsystems/php:7.2 php -v 65 | ``` 66 | 67 | This should result in *something* like: 68 | ``` 69 | PHP 7.2.8 (cli) (built: Jul 21 2018 07:56:11) ( NTS ) 70 | Copyright (c) 1997-2018 The PHP Group 71 | Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies 72 | with Zend OPcache v7.2.8, Copyright (c) 1999-2018, by Zend Technologies 73 | with blackfire v1.22.0~linux-x64-non_zts72, https://blackfire.io, by Blackfire 74 | ``` 75 | 76 | ### Production use 77 | 78 | In your application folder, you'll need to add a `Dockerfile` where you customize it, including adding your application. 79 | For example see for instance [Dockerfile in ezsystems/ezplatform](https://github.com/ezsystems/ezplatform/blob/master/doc/docker/Dockerfile-app). 80 | 81 | 82 | Then for building it you can for instance execute: 83 | ```bash 84 | docker build -t mycompany/myapp_volume:latest . 85 | ``` 86 | 87 | And by now you can execute some *(see below to attach database, ..)* commands to test it: 88 | ```bash 89 | docker run --rm mycompany/myapp_volume bin/console list 90 | ``` 91 | 92 | ### Development use 93 | 94 | *Warning: As of December 2016, avoid using Docker for Mac/Windows beta for this setup, as it's load times are typically 60-90 seconds because of IO issues way worse then what Virtualbox ever had when doing shared folder. Which is essentially what is being used here when not on Linux, and when using what Docker calls host mounted volumes.* 95 | 96 | To get started, lets set permissions for dev use _(Symfony 3.x structure reflected in example)_, and make sure to install composer packages: 97 | ```bash 98 | sudo mkdir -p web/var 99 | sudo find web/var var -type d | xargs sudo chmod -R 777 100 | sudo find web/var var -type f | xargs sudo chmod -R 666 101 | docker run --rm -u www-data -v `pwd`:/var/www -e SYMFONY_ENV=dev ezsystems/php:7.2 composer install --no-progress --no-interaction --prefer-dist 102 | ``` 103 | 104 | 105 | Now you can run some *(see below to attach database, ..)* commands to test it: 106 | ```bash 107 | docker run --rm -u www-data -v `pwd`:/var/www -e SYMFONY_ENV=dev ezsystems/php:7.2 bin/console list 108 | ``` 109 | 110 | 111 | ### Use with full setup (database, ..) 112 | 113 | For setting up a full setup with database and so on, see [ezplatform:doc/docker](https://github.com/ezsystems/ezplatform/tree/master/doc/docker) for further examples and instructions. 114 | 115 | 116 | ## Possible roadmap for this PHP image 117 | 118 | - PHP plugins: 119 | - pdo_pgsql + pdo_sqlite 120 | - env variable to set session handler, ... 121 | - Apache + mod_php variant 122 | - Alpine Linux; *To drop image size, assuming all other official images move to Alpine.* 123 | 124 | ## Copyright & license 125 | Copyright [eZ Systems AS](http://ez.no/), for copyright and license details see provided LICENSE file. 126 | -------------------------------------------------------------------------------- /bin/.travis/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # Builds ez_php:latest and ez_php:latest-node locally to avoid issues when pushing. 4 | 5 | set -e 6 | 7 | if [ "$1" = "" ]; then 8 | echo "Argument 1 variable PHP_VERSION (and default tag) is not set, format: 7.0. Bailing out !" 9 | exit 1 10 | fi 11 | 12 | if [ "$2" = "" ]; then 13 | echo "Argument 2 variable NODE_VERSION (and default tag) is not set, format: 10. Bailing out !" 14 | exit 1 15 | fi 16 | 17 | PHP_VERSION="$1" 18 | NODE_VERSION="$2" 19 | 20 | # Build prod container 21 | docker build --network=host --no-cache --rm=true --pull -f php/Dockerfile-${PHP_VERSION} -t ez_php:latest php/ 22 | 23 | # Build container with Node (will extend ez_php:latest, hence why --pull is skipped) 24 | docker build --network=host --no-cache --rm=true -f php/Dockerfile-node${NODE_VERSION} -t ez_php:latest-node php/ 25 | -------------------------------------------------------------------------------- /bin/.travis/push.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | set -e 4 | 5 | # Expects images from build.sh, as in: 6 | # - ez_php:latest 7 | # - ez_php:latest-node 8 | 9 | validateEnvironment() 10 | { 11 | if [ "$DOCKER_USERNAME" = "" ]; then 12 | echo "Environment variable DOCKER_USERNAME is not set. Bailing out !" 13 | exit 1 14 | fi 15 | if [ "$DOCKER_PASSWORD" = "" ]; then 16 | echo "Environment variable DOCKER_PASSWORD is not set. Bailing out !" 17 | exit 1 18 | fi 19 | } 20 | 21 | validateEnvironment 22 | 23 | if [ "$1" = "" ]; then 24 | echo "Argument 1 variable REMOTE_IMAGE is not set, format: ezsystems/php. Bailing out !" 25 | exit 1 26 | fi 27 | 28 | if [ "$2" = "" ]; then 29 | echo "Argument 2 variable VERSION_FORMAT is not set, format: ezsystems/php. Bailing out !" 30 | exit 1 31 | fi 32 | 33 | REMOTE_IMAGE="$1" 34 | VERSION_FORMAT="$2" 35 | 36 | PHP_VERSION=`docker -l error run ez_php:latest php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;"` 37 | NODE_VERSION=`docker -l error run ez_php:latest-node node -e "console.log(process.versions.node)"` 38 | NODE_VERSION=`echo $NODE_VERSION | cut -f 1 -d "."` 39 | 40 | docker images 41 | echo ${DOCKER_PASSWORD} | docker login -u ${DOCKER_USERNAME} --password-stdin 42 | 43 | ## TAGS 44 | echo "About to tag remote image '${REMOTE_IMAGE}' with php version '${PHP_VERSION}' and Node '${NODE_VERSION}'" 45 | 46 | # "7.0" 47 | docker tag ez_php:latest "${REMOTE_IMAGE}:${PHP_VERSION}" 48 | docker tag ez_php:latest-node "${REMOTE_IMAGE}:${PHP_VERSION}-node${NODE_VERSION}" 49 | 50 | # "7.0-v0" 51 | docker tag ez_php:latest "${REMOTE_IMAGE}:${PHP_VERSION}-${VERSION_FORMAT}" 52 | docker tag ez_php:latest-node "${REMOTE_IMAGE}:${PHP_VERSION}-${VERSION_FORMAT}-node${NODE_VERSION}" 53 | 54 | # "latest" (optional) 55 | if [ "$LATEST_PHP" = "$PHP_VERSION" ]; then 56 | docker tag ez_php:latest "${REMOTE_IMAGE}:latest" 57 | docker tag ez_php:latest-node "${REMOTE_IMAGE}:latest-node${NODE_VERSION}" 58 | if [ "$LATEST_NODE" = "$NODE_VERSION" ]; then 59 | docker tag ez_php:latest-node "${REMOTE_IMAGE}:latest-node" 60 | fi 61 | fi 62 | 63 | echo "Pushing docker image with all tags : ${REMOTE_IMAGE}" 64 | docker push --all-tags "${REMOTE_IMAGE}" 65 | -------------------------------------------------------------------------------- /bin/.travis/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | set -e 4 | # Expects images from build.sh, as in: 5 | # - ez_php:latest 6 | # - ez_php:latest-node 7 | REUSE_VOLUME=0 8 | 9 | ## Parse arguments 10 | for i in "$@"; do 11 | case $i in 12 | --reuse-volume) 13 | REUSE_VOLUME=1 14 | ;; 15 | *) 16 | printf "Not recognised argument: ${i}, only supported argument is: --reuse-volume" 17 | exit 1 18 | ;; 19 | esac 20 | done 21 | 22 | APP_ENV=${APP_ENV:-prod} 23 | SYMFONY_ENV=${SYMFONY_ENV:-prod} 24 | PRODUCT_VERSION=${PRODUCT_VERSION:-^3.3.x-dev} 25 | FORMAT_VERSION=${FORMAT_VERSION:-v2} 26 | 27 | if [ "$REUSE_VOLUME" = "0" ]; then 28 | printf "\n(Re-)Creating volumes/ezplatform for fresh checkout, needs sudo to delete old and chmod new folder\n" 29 | rm -Rf volumes/ezplatform 30 | # Use mode here so this can be run on Mac 31 | mkdir -pm 0777 volumes/ezplatform 32 | 33 | if [ "$COMPOSER_HOME" = "" ]; then 34 | COMPOSER_HOME=~/.composer 35 | fi 36 | 37 | printf "\nBuilding on ez_php:latest, composer will implicit check requirements\n" 38 | if [ "$PRODUCT_VERSION" = "^2.5" ]; then 39 | docker run -ti --rm \ 40 | -e SYMFONY_ENV \ 41 | -e PHP_INI_ENV_memory_limit=3G \ 42 | -v $(pwd)/volumes/ezplatform:/var/www \ 43 | -v $COMPOSER_HOME:/root/.composer \ 44 | ez_php:latest-node \ 45 | bash -c " 46 | composer --version && 47 | composer create-project --no-progress --no-interaction ezsystems/ezplatform /var/www $PRODUCT_VERSION" 48 | elif [ "$PRODUCT_VERSION" = "^3.3.x-dev" ]; then 49 | docker run -ti --rm \ 50 | -e APP_ENV \ 51 | -e PHP_INI_ENV_memory_limit=3G \ 52 | -v $(pwd)/volumes/ezplatform:/var/www \ 53 | -v $COMPOSER_HOME:/root/.composer \ 54 | ez_php:latest-node \ 55 | bash -c " 56 | composer --version && 57 | composer create-project --no-progress --no-interaction $COMPOSER_OPTIONS ibexa/website-skeleton /var/www $PRODUCT_VERSION && 58 | composer require ibexa/oss:$PRODUCT_VERSION -W --no-scripts $COMPOSER_OPTIONS 59 | git init && git add . && git commit -m 'Init' 60 | composer recipes:install ibexa/oss --force -v 61 | composer require ibexa/docker $COMPOSER_OPTIONS && 62 | composer require ezsystems/behatbundle:^8.3.x-dev --no-scripts --no-plugins $COMPOSER_OPTIONS && 63 | composer recipes:install ezsystems/behatbundle --force" 64 | fi 65 | fi 66 | 67 | printf "\nMake sure Node.js and Yarn are included in latest-node\n" 68 | docker -l error run -a stderr ez_php:latest-node node -e "process.versions.node" 69 | docker -l error run -a stderr ez_php:latest-node bash -c "yarn -v" 70 | 71 | printf "\nVersion and module information about php build\n" 72 | docker run -ti --rm ez_php:latest-node bash -c "php -v; php -m" 73 | 74 | printf "\nVersion and module information about php build with enabled xdebug\n" 75 | docker run -ti --rm -e ENABLE_XDEBUG="1" ez_php:latest-node bash -c "php -v; php -m" 76 | 77 | printf "\Integration: Behat testing on ez_php:latest and ez_php:latest-node with eZ Platform\n" 78 | cd volumes/ezplatform 79 | 80 | export COMPOSE_FILE="doc/docker/base-dev.yml:doc/docker/redis.yml:doc/docker/selenium.yml" 81 | export SYMFONY_ENV="behat" SYMFONY_DEBUG="1" 82 | export APP_ENV="behat" APP_DEBUG="1" 83 | export PHP_IMAGE="ez_php:latest-node" PHP_IMAGE_DEV="ez_php:latest-node" 84 | 85 | if [ "$PRODUCT_VERSION" = "^2.5" ]; then 86 | docker-compose --env-file .env -f doc/docker/install-dependencies.yml -f doc/docker/install-database.yml up --abort-on-container-exit 87 | docker-compose --env-file .env up -d --build --force-recreate 88 | echo '> Workaround for test issues: Change ownership of files inside docker container' 89 | docker-compose --env-file=.env exec app sh -c 'chown -R www-data:www-data /var/www' 90 | elif [ "$PRODUCT_VERSION" = "^3.3.x-dev" ]; then 91 | docker-compose --env-file .env up -d --build --force-recreate 92 | echo '> Workaround for test issues: Change ownership of files inside docker container' 93 | docker-compose --env-file=.env exec app sh -c 'chown -R www-data:www-data /var/www' 94 | # Rebuild Symfony container 95 | docker-compose --env-file=.env exec --user www-data app sh -c "rm -rf var/cache/*" 96 | docker-compose --env-file=.env exec --user www-data app php bin/console cache:clear 97 | # Install database & generate schema 98 | docker-compose --env-file=.env exec --user www-data app sh -c "php /scripts/wait_for_db.php; php bin/console ibexa:install" 99 | docker-compose --env-file=.env exec --user www-data app sh -c "php bin/console ibexa:graphql:generate-schema" 100 | docker-compose --env-file=.env exec --user www-data app sh -c "composer run post-install-cmd" 101 | fi 102 | 103 | docker-compose --env-file=.env exec --user www-data app sh -c "php /scripts/wait_for_db.php; php bin/console cache:warmup; $TEST_CMD" 104 | 105 | docker-compose --env-file .env down -v 106 | -------------------------------------------------------------------------------- /bin/.travis/update_docker.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # Update package info and selectively update docker-engine (and keep old travis specific config file) 4 | docker -v 5 | sudo apt-get update 6 | sudo apt-get --reinstall -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install docker-ce 7 | docker -v 8 | 9 | # If we need to pin it to a given version: 10 | # sudo apt-get --reinstall -y [...] install docker-engine=1.11.0-0~jessie 11 | # http://apt.dockerproject.org/repo/dists/debian-jessie/main/binary-amd64/Packages 12 | 13 | 14 | docker-compose -v 15 | DOCKER_COMPOSE_VERSION="1.25.1" 16 | echo "\nUpdating Docker Compose to ${DOCKER_COMPOSE_VERSION}" 17 | sudo rm -f /usr/local/bin/docker-compose 18 | curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose 19 | chmod +x docker-compose 20 | sudo mv docker-compose /usr/local/bin 21 | -------------------------------------------------------------------------------- /php/Dockerfile-7.1: -------------------------------------------------------------------------------- 1 | FROM php:7.1-fpm-stretch 2 | 3 | # Container containing php-fpm and php-cli to run and interact with eZ Platform and other Symfony projects 4 | # 5 | # It has two modes of operation: 6 | # - (run.sh cmd) [default] Reconfigure eZ Platform/Publish based on provided env variables and start php-fpm 7 | # - (bash|php|composer) Allows to execute composer, php or bash against the image 8 | 9 | # Set defaults for variables used by run.sh 10 | ENV COMPOSER_HOME=/root/.composer 11 | 12 | # Get packages that we need in container 13 | RUN apt-get update -q -y \ 14 | && apt-get install -q -y --no-install-recommends \ 15 | ca-certificates \ 16 | curl \ 17 | acl \ 18 | sudo \ 19 | # Disable expired Let's Encrypt certificate 20 | && sed -i '/mozilla\/DST_Root_CA_X3.crt/ s/./!&/' /etc/ca-certificates.conf \ 21 | && update-ca-certificates --verbose \ 22 | # Needed for the php extensions we enable below 23 | && apt-get install -q -y --no-install-recommends \ 24 | libfreetype6 \ 25 | libjpeg62-turbo \ 26 | libxpm4 \ 27 | libpng16-16 \ 28 | libicu57 \ 29 | libxslt1.1 \ 30 | libmemcachedutil2 \ 31 | imagemagick \ 32 | libpq5 \ 33 | # git & unzip needed for composer, unless we document to use dev image for composer install 34 | # unzip needed due to https://github.com/composer/composer/issues/4471 35 | unzip \ 36 | git \ 37 | # packages useful for dev 38 | less \ 39 | mariadb-client \ 40 | vim \ 41 | wget \ 42 | tree \ 43 | gdb-minimal \ 44 | && rm -rf /var/lib/apt/lists/* 45 | 46 | # Install and configure php plugins 47 | RUN set -xe \ 48 | && buildDeps=" \ 49 | $PHP_EXTRA_BUILD_DEPS \ 50 | libfreetype6-dev \ 51 | libjpeg62-turbo-dev \ 52 | libxpm-dev \ 53 | libpng-dev \ 54 | libicu-dev \ 55 | libxslt1-dev \ 56 | libmemcached-dev \ 57 | libxml2-dev \ 58 | libmagickwand-dev \ 59 | libpq-dev \ 60 | " \ 61 | && apt-get update -q -y && apt-get install -q -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \ 62 | # Extract php source and install missing extensions 63 | && docker-php-source extract \ 64 | && docker-php-ext-configure mysqli --with-mysqli=mysqlnd \ 65 | && docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \ 66 | && docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \ 67 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/ --with-xpm-dir=/usr/include/ --enable-gd-jis-conv \ 68 | && docker-php-ext-install exif gd mbstring intl xsl zip mysqli pdo_mysql pdo_pgsql pgsql soap bcmath \ 69 | && docker-php-ext-enable opcache \ 70 | && cp /usr/src/php/php.ini-production ${PHP_INI_DIR}/php.ini \ 71 | \ 72 | # Install imagemagick 73 | && for i in $(seq 1 3); do pecl install -o imagick && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 74 | && docker-php-ext-enable imagick \ 75 | # Install xdebug 76 | && for i in $(seq 1 3); do echo yes | pecl install -o "xdebug-2.9.8" && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 77 | # Install blackfire: https://blackfire.io/docs/integrations/docker 78 | && version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \ 79 | && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \ 80 | && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \ 81 | && mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \ 82 | && rm -f /tmp/blackfire-probe.tar.gz \ 83 | \ 84 | # Install igbinary (for more efficient serialization in redis/memcached) 85 | && for i in $(seq 1 3); do pecl install -o igbinary && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 86 | && docker-php-ext-enable igbinary \ 87 | \ 88 | # Install redis (manualy build in order to be able to enable igbinary) 89 | && for i in $(seq 1 3); do pecl install -o --nobuild redis && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 90 | && cd "$(pecl config-get temp_dir)/redis" \ 91 | && phpize \ 92 | && ./configure --enable-redis-igbinary \ 93 | && make \ 94 | && make install \ 95 | && docker-php-ext-enable redis \ 96 | && cd - \ 97 | \ 98 | # Install memcached (manualy build in order to be able to enable igbinary) 99 | && for i in $(seq 1 3); do echo no | pecl install -o --nobuild memcached && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 100 | && cd "$(pecl config-get temp_dir)/memcached" \ 101 | && phpize \ 102 | && ./configure --enable-memcached-igbinary \ 103 | && make \ 104 | && make install \ 105 | && docker-php-ext-enable memcached \ 106 | && cd - \ 107 | \ 108 | # Delete source & builds deps so it does not hang around in layers taking up space 109 | && pecl clear-cache \ 110 | && rm -Rf "$(pecl config-get temp_dir)/*" \ 111 | && docker-php-source delete \ 112 | && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps 113 | 114 | # Set timezone 115 | RUN echo "UTC" > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata 116 | 117 | # Set pid file to be able to restart php-fpm 118 | RUN sed -i "s@^\[global\]@\[global\]\n\npid = /run/php-fpm.pid@" ${PHP_INI_DIR}-fpm.conf 119 | 120 | COPY conf.d/blackfire.ini ${PHP_INI_DIR}/conf.d/blackfire.ini 121 | COPY conf.d/xdebug2.ini ${PHP_INI_DIR}/conf.d/xdebug.ini.disabled 122 | 123 | # Create Composer directory (cache and auth files) & Get Composer 124 | RUN mkdir -p $COMPOSER_HOME \ 125 | && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer 126 | 127 | # As application is put in as volume we do all needed operation on run 128 | COPY scripts /scripts 129 | 130 | # Add some custom config 131 | COPY conf.d/php.ini ${PHP_INI_DIR}/conf.d/php.ini 132 | 133 | RUN chmod 755 /scripts/*.sh 134 | 135 | # Needed for docker-machine 136 | RUN usermod -u 1000 www-data 137 | 138 | WORKDIR /var/www 139 | 140 | ENTRYPOINT ["/scripts/docker-entrypoint.sh"] 141 | 142 | CMD php-fpm 143 | 144 | EXPOSE 9000 145 | -------------------------------------------------------------------------------- /php/Dockerfile-7.2: -------------------------------------------------------------------------------- 1 | FROM php:7.2-fpm-stretch 2 | 3 | # Container containing php-fpm and php-cli to run and interact with eZ Platform and other Symfony projects 4 | # 5 | # It has two modes of operation: 6 | # - (run.sh cmd) [default] Reconfigure eZ Platform/Publish based on provided env variables and start php-fpm 7 | # - (bash|php|composer) Allows to execute composer, php or bash against the image 8 | 9 | # Set defaults for variables used by run.sh 10 | ENV COMPOSER_HOME=/root/.composer 11 | 12 | # Get packages that we need in container 13 | RUN apt-get update -q -y \ 14 | && apt-get install -q -y --no-install-recommends \ 15 | ca-certificates \ 16 | curl \ 17 | acl \ 18 | sudo \ 19 | # Disable expired Let's Encrypt certificate 20 | && sed -i '/mozilla\/DST_Root_CA_X3.crt/ s/./!&/' /etc/ca-certificates.conf \ 21 | && update-ca-certificates --verbose \ 22 | # Needed for the php extensions we enable below 23 | && apt-get install -q -y --no-install-recommends \ 24 | libfreetype6 \ 25 | libjpeg62-turbo \ 26 | libxpm4 \ 27 | libpng16-16 \ 28 | libicu57 \ 29 | libxslt1.1 \ 30 | libmemcachedutil2 \ 31 | imagemagick \ 32 | libpq5 \ 33 | # git & unzip needed for composer, unless we document to use dev image for composer install 34 | # unzip needed due to https://github.com/composer/composer/issues/4471 35 | unzip \ 36 | git \ 37 | # packages useful for dev 38 | less \ 39 | mariadb-client \ 40 | vim \ 41 | wget \ 42 | tree \ 43 | gdb-minimal \ 44 | && rm -rf /var/lib/apt/lists/* 45 | 46 | # Install and configure php plugins 47 | RUN set -xe \ 48 | && buildDeps=" \ 49 | $PHP_EXTRA_BUILD_DEPS \ 50 | libfreetype6-dev \ 51 | libjpeg62-turbo-dev \ 52 | libxpm-dev \ 53 | libpng-dev \ 54 | libicu-dev \ 55 | libxslt1-dev \ 56 | libmemcached-dev \ 57 | libxml2-dev \ 58 | libmagickwand-dev \ 59 | libpq-dev \ 60 | " \ 61 | && apt-get update -q -y && apt-get install -q -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \ 62 | # Extract php source and install missing extensions 63 | && docker-php-source extract \ 64 | && docker-php-ext-configure mysqli --with-mysqli=mysqlnd \ 65 | && docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \ 66 | && docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \ 67 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/ --with-xpm-dir=/usr/include/ --enable-gd-jis-conv \ 68 | && docker-php-ext-install exif gd mbstring intl xsl zip mysqli pdo_mysql pdo_pgsql pgsql soap bcmath \ 69 | && docker-php-ext-enable opcache \ 70 | && cp /usr/src/php/php.ini-production ${PHP_INI_DIR}/php.ini \ 71 | \ 72 | # Install imagemagick 73 | && for i in $(seq 1 3); do pecl install -o imagick && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 74 | && docker-php-ext-enable imagick \ 75 | # Install xdebug 76 | && for i in $(seq 1 3); do echo yes | pecl install -o "xdebug" && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 77 | # Install blackfire: https://blackfire.io/docs/integrations/docker 78 | && version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \ 79 | && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \ 80 | && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \ 81 | && mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \ 82 | && rm -f /tmp/blackfire-probe.tar.gz \ 83 | \ 84 | # Install igbinary (for more efficient serialization in redis/memcached) 85 | && for i in $(seq 1 3); do pecl install -o igbinary && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 86 | && docker-php-ext-enable igbinary \ 87 | \ 88 | # Install redis (manualy build in order to be able to enable igbinary) 89 | && for i in $(seq 1 3); do pecl install -o --nobuild redis && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 90 | && cd "$(pecl config-get temp_dir)/redis" \ 91 | && phpize \ 92 | && ./configure --enable-redis-igbinary \ 93 | && make \ 94 | && make install \ 95 | && docker-php-ext-enable redis \ 96 | && cd - \ 97 | \ 98 | # Install memcached (manualy build in order to be able to enable igbinary) 99 | && for i in $(seq 1 3); do echo no | pecl install -o --nobuild memcached && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 100 | && cd "$(pecl config-get temp_dir)/memcached" \ 101 | && phpize \ 102 | && ./configure --enable-memcached-igbinary \ 103 | && make \ 104 | && make install \ 105 | && docker-php-ext-enable memcached \ 106 | && cd - \ 107 | \ 108 | # Delete source & builds deps so it does not hang around in layers taking up space 109 | && pecl clear-cache \ 110 | && rm -Rf "$(pecl config-get temp_dir)/*" \ 111 | && docker-php-source delete \ 112 | && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps 113 | 114 | # Set timezone 115 | RUN echo "UTC" > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata 116 | 117 | # Set pid file to be able to restart php-fpm 118 | RUN sed -i "s@^\[global\]@\[global\]\n\npid = /run/php-fpm.pid@" ${PHP_INI_DIR}-fpm.conf 119 | 120 | COPY conf.d/blackfire.ini ${PHP_INI_DIR}/conf.d/blackfire.ini 121 | COPY conf.d/xdebug.ini ${PHP_INI_DIR}/conf.d/xdebug.ini.disabled 122 | 123 | # Create Composer directory (cache and auth files) & Get Composer 124 | RUN mkdir -p $COMPOSER_HOME \ 125 | && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer 126 | 127 | # As application is put in as volume we do all needed operation on run 128 | COPY scripts /scripts 129 | 130 | # Add some custom config 131 | COPY conf.d/php.ini ${PHP_INI_DIR}/conf.d/php.ini 132 | 133 | RUN chmod 755 /scripts/*.sh 134 | 135 | # Needed for docker-machine 136 | RUN usermod -u 1000 www-data 137 | 138 | WORKDIR /var/www 139 | 140 | ENTRYPOINT ["/scripts/docker-entrypoint.sh"] 141 | 142 | CMD php-fpm 143 | 144 | EXPOSE 9000 145 | -------------------------------------------------------------------------------- /php/Dockerfile-7.3: -------------------------------------------------------------------------------- 1 | FROM php:7.3-fpm-stretch 2 | 3 | # Container containing php-fpm and php-cli to run and interact with eZ Platform and other Symfony projects 4 | # 5 | # It has two modes of operation: 6 | # - (run.sh cmd) [default] Reconfigure eZ Platform/Publish based on provided env variables and start php-fpm 7 | # - (bash|php|composer) Allows to execute composer, php or bash against the image 8 | 9 | # Set defaults for variables used by run.sh 10 | ENV COMPOSER_HOME=/root/.composer 11 | 12 | # Get packages that we need in container 13 | RUN apt-get update -q -y \ 14 | && apt-get install -q -y --no-install-recommends \ 15 | ca-certificates \ 16 | curl \ 17 | acl \ 18 | sudo \ 19 | # Disable expired Let's Encrypt certificate 20 | && sed -i '/mozilla\/DST_Root_CA_X3.crt/ s/./!&/' /etc/ca-certificates.conf \ 21 | && update-ca-certificates --verbose \ 22 | # Needed for the php extensions we enable below 23 | && apt-get install -q -y --no-install-recommends \ 24 | libfreetype6 \ 25 | libjpeg62-turbo \ 26 | libxpm4 \ 27 | libpng16-16 \ 28 | libicu57 \ 29 | libxslt1.1 \ 30 | libmemcachedutil2 \ 31 | libzip4 \ 32 | imagemagick \ 33 | libpq5 \ 34 | # git & unzip needed for composer, unless we document to use dev image for composer install 35 | # unzip needed due to https://github.com/composer/composer/issues/4471 36 | unzip \ 37 | git \ 38 | # packages useful for dev 39 | less \ 40 | mariadb-client \ 41 | vim \ 42 | wget \ 43 | tree \ 44 | gdb-minimal \ 45 | && rm -rf /var/lib/apt/lists/* 46 | 47 | # Install and configure php plugins 48 | RUN set -xe \ 49 | && buildDeps=" \ 50 | $PHP_EXTRA_BUILD_DEPS \ 51 | libfreetype6-dev \ 52 | libjpeg62-turbo-dev \ 53 | libxpm-dev \ 54 | libpng-dev \ 55 | libicu-dev \ 56 | libxslt1-dev \ 57 | libmemcached-dev \ 58 | libzip-dev \ 59 | libxml2-dev \ 60 | libmagickwand-dev \ 61 | libpq-dev \ 62 | " \ 63 | && apt-get update -q -y && apt-get install -q -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \ 64 | # Extract php source and install missing extensions 65 | && docker-php-source extract \ 66 | && docker-php-ext-configure mysqli --with-mysqli=mysqlnd \ 67 | && docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \ 68 | && docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \ 69 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/ --with-xpm-dir=/usr/include/ --enable-gd-jis-conv \ 70 | && docker-php-ext-install exif gd mbstring intl xsl zip mysqli pdo_mysql pdo_pgsql pgsql soap bcmath \ 71 | && docker-php-ext-enable opcache \ 72 | && cp /usr/src/php/php.ini-production ${PHP_INI_DIR}/php.ini \ 73 | \ 74 | # Install imagemagick 75 | && for i in $(seq 1 3); do pecl install -o imagick && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 76 | && docker-php-ext-enable imagick \ 77 | # Install xdebug 78 | && for i in $(seq 1 3); do echo yes | pecl install -o "xdebug" && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 79 | # Install blackfire: https://blackfire.io/docs/integrations/docker 80 | && version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \ 81 | && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \ 82 | && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \ 83 | && mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \ 84 | && rm -f /tmp/blackfire-probe.tar.gz \ 85 | \ 86 | # Install igbinary (for more efficient serialization in redis/memcached) 87 | && for i in $(seq 1 3); do pecl install -o igbinary && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 88 | && docker-php-ext-enable igbinary \ 89 | \ 90 | # Install redis (manualy build in order to be able to enable igbinary) 91 | && for i in $(seq 1 3); do pecl install -o --nobuild redis && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 92 | && cd "$(pecl config-get temp_dir)/redis" \ 93 | && phpize \ 94 | && ./configure --enable-redis-igbinary \ 95 | && make \ 96 | && make install \ 97 | && docker-php-ext-enable redis \ 98 | && cd - \ 99 | \ 100 | # Install memcached (manualy build in order to be able to enable igbinary) 101 | && for i in $(seq 1 3); do echo no | pecl install -o --nobuild memcached && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 102 | && cd "$(pecl config-get temp_dir)/memcached" \ 103 | && phpize \ 104 | && ./configure --enable-memcached-igbinary \ 105 | && make \ 106 | && make install \ 107 | && docker-php-ext-enable memcached \ 108 | && cd - \ 109 | \ 110 | # Delete source & builds deps so it does not hang around in layers taking up space 111 | && pecl clear-cache \ 112 | && rm -Rf "$(pecl config-get temp_dir)/*" \ 113 | && docker-php-source delete \ 114 | && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps 115 | 116 | # Set timezone 117 | RUN echo "UTC" > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata 118 | 119 | # Set pid file to be able to restart php-fpm 120 | RUN sed -i "s@^\[global\]@\[global\]\n\npid = /run/php-fpm.pid@" ${PHP_INI_DIR}-fpm.conf 121 | 122 | COPY conf.d/blackfire.ini ${PHP_INI_DIR}/conf.d/blackfire.ini 123 | COPY conf.d/xdebug.ini ${PHP_INI_DIR}/conf.d/xdebug.ini.disabled 124 | 125 | # Create Composer directory (cache and auth files) & Get Composer 126 | RUN mkdir -p $COMPOSER_HOME \ 127 | && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer 128 | 129 | # As application is put in as volume we do all needed operation on run 130 | COPY scripts /scripts 131 | 132 | # Add some custom config 133 | COPY conf.d/php.ini ${PHP_INI_DIR}/conf.d/php.ini 134 | 135 | RUN chmod 755 /scripts/*.sh 136 | 137 | # Needed for docker-machine 138 | RUN usermod -u 1000 www-data 139 | 140 | WORKDIR /var/www 141 | 142 | ENTRYPOINT ["/scripts/docker-entrypoint.sh"] 143 | 144 | CMD php-fpm 145 | 146 | EXPOSE 9000 147 | -------------------------------------------------------------------------------- /php/Dockerfile-7.4: -------------------------------------------------------------------------------- 1 | FROM php:7.4-fpm-buster 2 | 3 | # Container containing php-fpm and php-cli to run and interact with eZ Platform and other Symfony projects 4 | # 5 | # It has two modes of operation: 6 | # - (run.sh cmd) [default] Reconfigure eZ Platform/Publish based on provided env variables and start php-fpm 7 | # - (bash|php|composer) Allows to execute composer, php or bash against the image 8 | 9 | # Set defaults for variables used by run.sh 10 | ENV COMPOSER_HOME=/root/.composer 11 | 12 | # Get packages that we need in container 13 | RUN apt-get update -q -y \ 14 | && apt-get install -q -y --no-install-recommends \ 15 | ca-certificates \ 16 | curl \ 17 | acl \ 18 | sudo \ 19 | # Disable expired Let's Encrypt certificate 20 | && sed -i '/mozilla\/DST_Root_CA_X3.crt/ s/./!&/' /etc/ca-certificates.conf \ 21 | && update-ca-certificates --verbose \ 22 | # Needed for the php extensions we enable below 23 | && apt-get install -q -y --no-install-recommends \ 24 | libfreetype6 \ 25 | libjpeg62-turbo \ 26 | libxpm4 \ 27 | libpng16-16 \ 28 | libicu63 \ 29 | libxslt1.1 \ 30 | libmemcachedutil2 \ 31 | libzip4 \ 32 | imagemagick \ 33 | libonig5 \ 34 | libpq5 \ 35 | # git & unzip needed for composer, unless we document to use dev image for composer install 36 | # unzip needed due to https://github.com/composer/composer/issues/4471 37 | unzip \ 38 | git \ 39 | # packages useful for dev 40 | less \ 41 | mariadb-client \ 42 | vim \ 43 | wget \ 44 | tree \ 45 | gdb-minimal \ 46 | && rm -rf /var/lib/apt/lists/* 47 | 48 | # Install and configure php plugins 49 | RUN set -xe \ 50 | && buildDeps=" \ 51 | $PHP_EXTRA_BUILD_DEPS \ 52 | libfreetype6-dev \ 53 | libjpeg62-turbo-dev \ 54 | libxpm-dev \ 55 | libpng-dev \ 56 | libicu-dev \ 57 | libxslt1-dev \ 58 | libmemcached-dev \ 59 | libzip-dev \ 60 | libxml2-dev \ 61 | libonig-dev \ 62 | libmagickwand-dev \ 63 | libpq-dev \ 64 | " \ 65 | && apt-get update -q -y && apt-get install -q -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \ 66 | # Extract php source and install missing extensions 67 | && docker-php-source extract \ 68 | && docker-php-ext-configure mysqli --with-mysqli=mysqlnd \ 69 | && docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \ 70 | && docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \ 71 | && docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ --with-xpm=/usr/include/ --enable-gd-jis-conv \ 72 | && docker-php-ext-install exif gd mbstring intl xsl zip mysqli pdo_mysql pdo_pgsql pgsql soap bcmath \ 73 | && docker-php-ext-enable opcache \ 74 | && cp /usr/src/php/php.ini-production ${PHP_INI_DIR}/php.ini \ 75 | \ 76 | # Install imagemagick 77 | && for i in $(seq 1 3); do pecl install -o imagick && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 78 | && docker-php-ext-enable imagick \ 79 | # Install xdebug 80 | && for i in $(seq 1 3); do echo yes | pecl install -o "xdebug" && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 81 | # Install blackfire: https://blackfire.io/docs/integrations/docker 82 | && version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \ 83 | && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \ 84 | && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \ 85 | && mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \ 86 | && rm -f /tmp/blackfire-probe.tar.gz \ 87 | \ 88 | # Install igbinary (for more efficient serialization in redis/memcached) 89 | && for i in $(seq 1 3); do pecl install -o igbinary && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 90 | && docker-php-ext-enable igbinary \ 91 | \ 92 | # Install redis (manualy build in order to be able to enable igbinary) 93 | && for i in $(seq 1 3); do pecl install -o --nobuild redis && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 94 | && cd "$(pecl config-get temp_dir)/redis" \ 95 | && phpize \ 96 | && ./configure --enable-redis-igbinary \ 97 | && make \ 98 | && make install \ 99 | && docker-php-ext-enable redis \ 100 | && cd - \ 101 | \ 102 | # Install memcached (manualy build in order to be able to enable igbinary) 103 | && for i in $(seq 1 3); do echo no | pecl install -o --nobuild memcached && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 104 | && cd "$(pecl config-get temp_dir)/memcached" \ 105 | && phpize \ 106 | && ./configure --enable-memcached-igbinary \ 107 | && make \ 108 | && make install \ 109 | && docker-php-ext-enable memcached \ 110 | && cd - \ 111 | \ 112 | # Delete source & builds deps so it does not hang around in layers taking up space 113 | && pecl clear-cache \ 114 | && rm -Rf "$(pecl config-get temp_dir)/*" \ 115 | && docker-php-source delete \ 116 | && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps 117 | 118 | # Set timezone 119 | RUN echo "UTC" > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata 120 | 121 | # Set pid file to be able to restart php-fpm 122 | RUN sed -i "s@^\[global\]@\[global\]\n\npid = /run/php-fpm.pid@" ${PHP_INI_DIR}-fpm.conf 123 | 124 | COPY conf.d/blackfire.ini ${PHP_INI_DIR}/conf.d/blackfire.ini 125 | COPY conf.d/xdebug.ini ${PHP_INI_DIR}/conf.d/xdebug.ini.disabled 126 | 127 | # Create Composer directory (cache and auth files) & Get Composer 128 | RUN mkdir -p $COMPOSER_HOME \ 129 | && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer 130 | 131 | # As application is put in as volume we do all needed operation on run 132 | COPY scripts /scripts 133 | 134 | # Add some custom config 135 | COPY conf.d/php.ini ${PHP_INI_DIR}/conf.d/php.ini 136 | 137 | RUN chmod 755 /scripts/*.sh 138 | 139 | # Needed for docker-machine 140 | RUN usermod -u 1000 www-data 141 | 142 | WORKDIR /var/www 143 | 144 | ENTRYPOINT ["/scripts/docker-entrypoint.sh"] 145 | 146 | CMD php-fpm 147 | 148 | EXPOSE 9000 149 | -------------------------------------------------------------------------------- /php/Dockerfile-8.0: -------------------------------------------------------------------------------- 1 | FROM php:8.0-fpm-bullseye 2 | 3 | # Container containing php-fpm and php-cli to run and interact with Ibexa DXP 4 | 5 | # Set defaults for variables used by run.sh 6 | ENV COMPOSER_HOME=/root/.composer 7 | 8 | # Get packages that we need in container 9 | RUN apt-get update -q -y \ 10 | && apt-get install -q -y --no-install-recommends \ 11 | ca-certificates \ 12 | curl \ 13 | acl \ 14 | sudo \ 15 | # Needed for the php extensions we enable below 16 | # gd 17 | libfreetype6 \ 18 | libjpeg62-turbo \ 19 | libxpm4 \ 20 | libpng16-16 \ 21 | # intl 22 | libicu67 \ 23 | # xslt 24 | libxslt1.1 \ 25 | # memcached 26 | libmemcachedutil2 \ 27 | # zip 28 | libzip4 \ 29 | # imagick 30 | imagemagick \ 31 | # mbstring 32 | libonig5 \ 33 | # PostgreSQL 34 | libpq5 \ 35 | # git & unzip needed for composer, unless we document to use dev image for composer install 36 | # unzip needed due to https://github.com/composer/composer/issues/4471 37 | unzip \ 38 | git \ 39 | # packages useful for dev 40 | less \ 41 | mariadb-client \ 42 | vim \ 43 | wget \ 44 | tree \ 45 | gdb-minimal \ 46 | && rm -rf /var/lib/apt/lists/* 47 | 48 | # Install and configure php plugins 49 | RUN set -xe \ 50 | && buildDeps=" \ 51 | # gd 52 | libjpeg62-turbo-dev \ 53 | libpng-dev \ 54 | libxpm-dev \ 55 | libfreetype6-dev \ 56 | # PostgreSQL 57 | libpq-dev \ 58 | # mbstring \ 59 | libonig-dev \ 60 | # intl 61 | libicu-dev \ 62 | # xsl 63 | libxslt1-dev \ 64 | # zip 65 | libzip-dev \ 66 | # imagick 67 | libmagickwand-dev \ 68 | # memcached 69 | libmemcached-dev \ 70 | " \ 71 | && apt-get update -q -y && apt-get install -q -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \ 72 | # Extract php source and install missing extensions 73 | && docker-php-source extract \ 74 | && docker-php-ext-configure mysqli --with-mysqli=mysqlnd \ 75 | && docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \ 76 | && docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \ 77 | && docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ --with-xpm=/usr/include/ --enable-gd-jis-conv \ 78 | && docker-php-ext-install exif gd mbstring intl xsl zip mysqli pdo_mysql pdo_pgsql pgsql soap bcmath \ 79 | && docker-php-ext-enable opcache \ 80 | && cp /usr/src/php/php.ini-production ${PHP_INI_DIR}/php.ini \ 81 | \ 82 | # Install imagemagick 83 | && for i in $(seq 1 3); do pecl install -o imagick && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 84 | && docker-php-ext-enable imagick \ 85 | # Install xdebug 86 | && for i in $(seq 1 3); do echo yes | pecl install -o "xdebug" && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 87 | # Install blackfire: https://blackfire.io/docs/integrations/docker 88 | && version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \ 89 | && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \ 90 | && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \ 91 | && mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \ 92 | && rm -f /tmp/blackfire-probe.tar.gz \ 93 | \ 94 | # Install igbinary (for more efficient serialization in redis/memcached) 95 | && for i in $(seq 1 3); do pecl install -o igbinary && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 96 | && docker-php-ext-enable igbinary \ 97 | \ 98 | # Install redis (manualy build in order to be able to enable igbinary) 99 | && for i in $(seq 1 3); do pecl install -o --nobuild redis && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 100 | && cd "$(pecl config-get temp_dir)/redis" \ 101 | && phpize \ 102 | && ./configure --enable-redis-igbinary \ 103 | && make \ 104 | && make install \ 105 | && docker-php-ext-enable redis \ 106 | && cd - \ 107 | \ 108 | # Install memcached (manualy build in order to be able to enable igbinary) 109 | && for i in $(seq 1 3); do echo no | pecl install -o --nobuild memcached && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 110 | && cd "$(pecl config-get temp_dir)/memcached" \ 111 | && phpize \ 112 | && ./configure --enable-memcached-igbinary \ 113 | && make \ 114 | && make install \ 115 | && docker-php-ext-enable memcached \ 116 | && cd - \ 117 | \ 118 | # Delete source & builds deps so it does not hang around in layers taking up space 119 | && pecl clear-cache \ 120 | && rm -Rf "$(pecl config-get temp_dir)/*" \ 121 | && docker-php-source delete \ 122 | && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps 123 | 124 | # Set timezone 125 | RUN echo "UTC" > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata 126 | 127 | # Set pid file to be able to restart php-fpm 128 | RUN sed -i "s@^\[global\]@\[global\]\n\npid = /run/php-fpm.pid@" ${PHP_INI_DIR}-fpm.conf 129 | 130 | COPY conf.d/blackfire.ini ${PHP_INI_DIR}/conf.d/blackfire.ini 131 | COPY conf.d/xdebug.ini ${PHP_INI_DIR}/conf.d/xdebug.ini.disabled 132 | 133 | # Create Composer directory (cache and auth files) & Get Composer 134 | RUN mkdir -p $COMPOSER_HOME \ 135 | && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer 136 | 137 | # As application is put in as volume we do all needed operation on run 138 | COPY scripts /scripts 139 | 140 | # Add some custom config 141 | COPY conf.d/php.ini ${PHP_INI_DIR}/conf.d/php.ini 142 | 143 | RUN chmod 755 /scripts/*.sh 144 | 145 | # Needed for docker-machine 146 | RUN usermod -u 1000 www-data 147 | 148 | WORKDIR /var/www 149 | 150 | ENTRYPOINT ["/scripts/docker-entrypoint.sh"] 151 | 152 | CMD php-fpm 153 | 154 | EXPOSE 9000 155 | -------------------------------------------------------------------------------- /php/Dockerfile-8.1: -------------------------------------------------------------------------------- 1 | FROM php:8.1-fpm-bullseye 2 | 3 | # Container containing php-fpm and php-cli to run and interact with Ibexa DXP 4 | 5 | # Set defaults for variables used by run.sh 6 | ENV COMPOSER_HOME=/root/.composer 7 | 8 | # Get packages that we need in container 9 | RUN apt-get update -q -y \ 10 | && apt-get install -q -y --no-install-recommends \ 11 | ca-certificates \ 12 | curl \ 13 | acl \ 14 | sudo \ 15 | # Needed for the php extensions we enable below 16 | # gd 17 | libfreetype6 \ 18 | libjpeg62-turbo \ 19 | libxpm4 \ 20 | libpng16-16 \ 21 | # intl 22 | libicu67 \ 23 | # xslt 24 | libxslt1.1 \ 25 | # memcached 26 | libmemcachedutil2 \ 27 | # zip 28 | libzip4 \ 29 | # imagick 30 | imagemagick \ 31 | # mbstring 32 | libonig5 \ 33 | # PostgreSQL 34 | libpq5 \ 35 | # git & unzip needed for composer, unless we document to use dev image for composer install 36 | # unzip needed due to https://github.com/composer/composer/issues/4471 37 | unzip \ 38 | git \ 39 | # packages useful for dev 40 | less \ 41 | mariadb-client \ 42 | vim \ 43 | wget \ 44 | tree \ 45 | gdb-minimal \ 46 | && rm -rf /var/lib/apt/lists/* 47 | 48 | # Install and configure php plugins 49 | RUN set -xe \ 50 | && buildDeps=" \ 51 | # gd 52 | libjpeg62-turbo-dev \ 53 | libpng-dev \ 54 | libxpm-dev \ 55 | libfreetype6-dev \ 56 | # PostgreSQL 57 | libpq-dev \ 58 | # mbstring \ 59 | libonig-dev \ 60 | # intl 61 | libicu-dev \ 62 | # xsl 63 | libxslt1-dev \ 64 | # zip 65 | libzip-dev \ 66 | # imagick 67 | libmagickwand-dev \ 68 | # memcached 69 | libmemcached-dev \ 70 | " \ 71 | && apt-get update -q -y && apt-get install -q -y --no-install-recommends $buildDeps && rm -rf /var/lib/apt/lists/* \ 72 | # Extract php source and install missing extensions 73 | && docker-php-source extract \ 74 | && docker-php-ext-configure mysqli --with-mysqli=mysqlnd \ 75 | && docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \ 76 | && docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \ 77 | && docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ --with-xpm=/usr/include/ --enable-gd-jis-conv \ 78 | && docker-php-ext-install exif gd mbstring intl xsl zip mysqli pdo_mysql pdo_pgsql pgsql soap bcmath \ 79 | && docker-php-ext-enable opcache \ 80 | && cp /usr/src/php/php.ini-production ${PHP_INI_DIR}/php.ini \ 81 | \ 82 | # Install imagemagick 83 | && for i in $(seq 1 3); do pecl install -o imagick && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 84 | && docker-php-ext-enable imagick \ 85 | # Install xdebug 86 | && for i in $(seq 1 3); do echo yes | pecl install -o "xdebug" && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 87 | # Install blackfire: https://blackfire.io/docs/integrations/docker 88 | && version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \ 89 | && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \ 90 | && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \ 91 | && mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \ 92 | && rm -f /tmp/blackfire-probe.tar.gz \ 93 | \ 94 | # Install igbinary (for more efficient serialization in redis/memcached) 95 | && for i in $(seq 1 3); do pecl install -o igbinary && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 96 | && docker-php-ext-enable igbinary \ 97 | \ 98 | # Install redis (manualy build in order to be able to enable igbinary) 99 | && for i in $(seq 1 3); do pecl install -o --nobuild redis && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 100 | && cd "$(pecl config-get temp_dir)/redis" \ 101 | && phpize \ 102 | && ./configure --enable-redis-igbinary \ 103 | && make \ 104 | && make install \ 105 | && docker-php-ext-enable redis \ 106 | && cd - \ 107 | \ 108 | # Install memcached (manualy build in order to be able to enable igbinary) 109 | && for i in $(seq 1 3); do echo no | pecl install -o --nobuild memcached && s=0 && break || s=$? && sleep 1; done; (exit $s) \ 110 | && cd "$(pecl config-get temp_dir)/memcached" \ 111 | && phpize \ 112 | && ./configure --enable-memcached-igbinary \ 113 | && make \ 114 | && make install \ 115 | && docker-php-ext-enable memcached \ 116 | && cd - \ 117 | \ 118 | # Delete source & builds deps so it does not hang around in layers taking up space 119 | && pecl clear-cache \ 120 | && rm -Rf "$(pecl config-get temp_dir)/*" \ 121 | && docker-php-source delete \ 122 | && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps 123 | 124 | # Set timezone 125 | RUN echo "UTC" > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata 126 | 127 | # Set pid file to be able to restart php-fpm 128 | RUN sed -i "s@^\[global\]@\[global\]\n\npid = /run/php-fpm.pid@" ${PHP_INI_DIR}-fpm.conf 129 | 130 | COPY conf.d/blackfire.ini ${PHP_INI_DIR}/conf.d/blackfire.ini 131 | COPY conf.d/xdebug.ini ${PHP_INI_DIR}/conf.d/xdebug.ini.disabled 132 | 133 | # Create Composer directory (cache and auth files) & Get Composer 134 | RUN mkdir -p $COMPOSER_HOME \ 135 | && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer 136 | 137 | # As application is put in as volume we do all needed operation on run 138 | COPY scripts /scripts 139 | 140 | # Add some custom config 141 | COPY conf.d/php.ini ${PHP_INI_DIR}/conf.d/php.ini 142 | 143 | RUN chmod 755 /scripts/*.sh 144 | 145 | # Needed for docker-machine 146 | RUN usermod -u 1000 www-data 147 | 148 | WORKDIR /var/www 149 | 150 | ENTRYPOINT ["/scripts/docker-entrypoint.sh"] 151 | 152 | CMD php-fpm 153 | 154 | EXPOSE 9000 155 | -------------------------------------------------------------------------------- /php/Dockerfile-node10: -------------------------------------------------------------------------------- 1 | FROM ez_php:latest 2 | 3 | # Install Node.js and Yarn 4 | RUN apt-get update -q -y \ 5 | && apt-get install -q -y --no-install-recommends gnupg \ 6 | && curl -sL https://deb.nodesource.com/setup_10.x | bash - \ 7 | && apt-get install -y nodejs \ 8 | && curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ 9 | && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ 10 | && sudo apt-get update && sudo apt-get install yarn \ 11 | && rm -rf /var/lib/apt/lists/* 12 | -------------------------------------------------------------------------------- /php/Dockerfile-node12: -------------------------------------------------------------------------------- 1 | FROM ez_php:latest 2 | 3 | # Install Node.js and Yarn 4 | RUN apt-get update -q -y \ 5 | && apt-get install -q -y --no-install-recommends gnupg \ 6 | && curl -sL https://deb.nodesource.com/setup_12.x | bash - \ 7 | && apt-get install -y nodejs \ 8 | && curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ 9 | && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ 10 | && sudo apt-get update && sudo apt-get install yarn \ 11 | && rm -rf /var/lib/apt/lists/* 12 | -------------------------------------------------------------------------------- /php/Dockerfile-node14: -------------------------------------------------------------------------------- 1 | FROM ez_php:latest 2 | 3 | # Install Node.js and Yarn 4 | RUN apt-get update -q -y \ 5 | && apt-get install -q -y --no-install-recommends gnupg \ 6 | && curl -sL https://deb.nodesource.com/setup_14.x | bash - \ 7 | && apt-get install -y nodejs \ 8 | && curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ 9 | && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ 10 | && sudo apt-get update && sudo apt-get install yarn \ 11 | && rm -rf /var/lib/apt/lists/* 12 | -------------------------------------------------------------------------------- /php/Dockerfile-node16: -------------------------------------------------------------------------------- 1 | FROM ez_php:latest 2 | 3 | # Install Node.js and Yarn 4 | RUN apt-get update -q -y \ 5 | && apt-get install -q -y --no-install-recommends gnupg \ 6 | && curl -sL https://deb.nodesource.com/setup_16.x | bash - \ 7 | && apt-get install -y nodejs \ 8 | && curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ 9 | && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ 10 | && sudo apt-get update && sudo apt-get install yarn \ 11 | && rm -rf /var/lib/apt/lists/* 12 | -------------------------------------------------------------------------------- /php/conf.d/blackfire.ini: -------------------------------------------------------------------------------- 1 | extension=blackfire.so 2 | blackfire.agent_socket=tcp://blackfire:8707 3 | -------------------------------------------------------------------------------- /php/conf.d/php.ini: -------------------------------------------------------------------------------- 1 | ; Set defaults that should be enough for most normal use. 2 | memory_limit=256M 3 | max_execution_time=90 4 | 5 | ; Set timezone, uses UTC by default to make sure data is stored in universial time. 6 | ; Adjust your existing data if you have any if you change this, and also make sure it's configured for the os: 7 | ; RUN echo $TIMEZONE > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata 8 | date.timezone=UTC 9 | 10 | ; Some tweaks to improve performance 11 | realpath_cache_size=4096K 12 | realpath_cache_ttl=600 13 | 14 | ; Tweak opcache to your own needs, further reading: 15 | ; https://secure.php.net/manual/en/opcache.installation.php 16 | ; https://tideways.io/profiler/blog/fine-tune-your-opcache-configuration-to-avoid-caching-suprises 17 | opcache.enable=1 18 | opcache.enable_cli=1 19 | opcache.memory_consumption=128 20 | opcache.interned_strings_buffer=8 21 | opcache.max_accelerated_files=20000 22 | opcache.max_wasted_percentage=10 23 | 24 | ; Might make sense for some use cases (however not for dev, and validate_timestamps=0 would be better for prod) 25 | ;opcache.revalidate_freq=60 26 | 27 | ; Un comment (disable) for apps that don't swap cwd (like eZ Publish 5.x / Legacy bridge does) 28 | ;opcache.use_cwd=0 29 | 30 | ; Should only be used for real prod (e.g. when code is mounted to a container read only) 31 | ; Implies no cache systems caching to php files and changing the file over the container lifecycle 32 | ;opcache.validate_timestamps=0 33 | ;opcache.enable_file_override=0 34 | 35 | ; SESSION 36 | ; Use igbinary for session serialization 37 | session.serialize_handler=igbinary 38 | 39 | ; Don't show php version to the world 40 | expose_php = Off 41 | -------------------------------------------------------------------------------- /php/conf.d/xdebug.ini: -------------------------------------------------------------------------------- 1 | zend_extension=xdebug.so 2 | 3 | ; Configuration file for xdebug 3 4 | 5 | ; Enable full error reporting (instead of default value hiding strict/notices/deprecations) 6 | error_reporting=E_ALL 7 | display_errors=On 8 | 9 | ; Extend default timeouts for dev image usage. 10 | max_execution_time=140 11 | max_input_time=140 12 | 13 | ; Use by seeting IDE to listen to port 9000 and specify env XDEBUG_CONFIG: remote_host={{YOUR_IP_ADDRESS}} 14 | xdebug.remote_autostart=off 15 | 16 | ; Allow profiling by using GET/POST/COOKIE vars, like done by xdebug extension for chrome/firefox 17 | ; Note: For better profiling see provided backfire integration. 18 | xdebug.mode=profile,debug 19 | xdebug.start_with_request=trigger 20 | xdebug.profiler_output_name=xdebug.out.%t 21 | xdebug.output_dir=/var/www/app/log 22 | -------------------------------------------------------------------------------- /php/conf.d/xdebug2.ini: -------------------------------------------------------------------------------- 1 | zend_extension=xdebug.so 2 | 3 | ; Enable full error reporting (instead of default value hiding strict/notices/deprecations) 4 | error_reporting=E_ALL 5 | display_errors=On 6 | 7 | ; Extend default timeouts for dev image usage. 8 | max_execution_time=140 9 | max_input_time=140 10 | 11 | ; Use by seeting IDE to listen to port 9000 and specify env XDEBUG_CONFIG: remote_host={{YOUR_IP_ADDRESS}} 12 | xdebug.remote_enable=on 13 | xdebug.remote_autostart=off 14 | 15 | ; Allow profiling by using GET/POST/COOKIE vars, like done by xdebug extension for chrome/firefox 16 | ; Note: For better profiling see provided backfire integration. 17 | xdebug.profiler_enable=1 18 | xdebug.profiler_output_name=xdebug.out.%t 19 | xdebug.profiler_output_dir=/var/www/app/log 20 | xdebug.profiler_enable_trigger=1 21 | -------------------------------------------------------------------------------- /php/scripts/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # See: 6 | # - Doc: https://docs.docker.com/engine/reference/builder/#entrypoint 7 | # - Example: https://github.com/docker-library/mariadb/blob/master/10.1/docker-entrypoint.sh 8 | # 9 | # Example use: 10 | # ./docker-entrypoint.sh php-fpm 11 | 12 | 13 | ## Clear container on start by default 14 | if [ "$NO_FORCE_SF_CONTAINER_REFRESH" != "" ]; then 15 | logger "NO_FORCE_SF_CONTAINER_REFRESH set, skipping Symfony container clearing on startup." 16 | elif [ -d var/cache ]; then 17 | logger "Symfony 3.x structure detected, container is not cleared on startup, use 3.2+ env variables support and warmup container during build." 18 | elif [ -d ezpublish/cache ]; then 19 | logger "Deleting ezpublish/cache/*/*ProjectContainer.php to make sure environment variables are picked up" 20 | rm -f ezpublish/cache/*/*ProjectContainer.php 21 | elif [ -d app/cache ]; then 22 | logger "Deleting app/cache/*/*ProjectContainer.php to make sure environment variables are picked up" 23 | rm -f app/cache/*/*ProjectContainer.php 24 | fi 25 | 26 | ## Adjust behat.yml if asked for from localhost setup to use defined hosts 27 | if [ "$BEHAT_SELENIUM_HOST" != "" ] && [ "$BEHAT_WEB_HOST" != "" ]; then 28 | logger "Copying behat.yml.dist to behat.yml and updating selenium and web hosts" 29 | if [ -f behat.yml.dist ]; then 30 | cp -f behat.yml.dist behat.yml 31 | if [ "$MINK_DEFAULT_SESSION" != "" ]; then sed -i "s@javascript_session: selenium@javascript_session: ${MINK_DEFAULT_SESSION}@" behat.yml; fi 32 | sed -i "s@localhost:4444@${BEHAT_SELENIUM_HOST}:4444@" behat.yml 33 | if [ "$BEHAT_CHROMIUM_HOST" != "" ]; then sed -i "s@localhost:9222@${BEHAT_CHROMIUM_HOST}:9222@" behat.yml; fi 34 | sed -i "s@localhost@${BEHAT_WEB_HOST}@" behat.yml 35 | else 36 | logger "No behat.yml.dist found, skipping" 37 | fi 38 | fi 39 | 40 | ## Enable xdebug if ENABLE_XDEBUG env is defined 41 | if [ ! -f ${PHP_INI_DIR}/conf.d/xdebug.ini ] && [ "${ENABLE_XDEBUG}" != "" ]; then 42 | logger "Enabling xdebug" 43 | mv ${PHP_INI_DIR}/conf.d/xdebug.ini.disabled ${PHP_INI_DIR}/conf.d/xdebug.ini 44 | fi 45 | 46 | ## Auto adjust log folder for xdebug if enabled 47 | if [ ! -d app ] && [ -f ${PHP_INI_DIR}/conf.d/xdebug.ini ]; then 48 | if [ -d ezpublish/log ]; then 49 | logger "Auto adjusting xdebug settings to log in ezpublish/log" 50 | sed -i "s@/var/www/app/log@/var/www/ezpublish/log@" ${PHP_INI_DIR}/conf.d/xdebug.ini 51 | elif [ -d var/log ]; then 52 | logger "Auto adjusting xdebug settings to log in var/log" 53 | sed -i "s@/var/www/app/log@/var/www/var/log@" ${PHP_INI_DIR}/conf.d/xdebug.ini 54 | fi 55 | fi 56 | 57 | # docker-entrypoint-initdb.d, as provided by most official images allows for direct usage and extended images to 58 | # extend behaviour without modifying this file. 59 | for f in /docker-entrypoint-initdb.d/*; do 60 | case "$f" in 61 | *.sh) logger "$0: running $f"; . "$f" ;; 62 | "/docker-entrypoint-initdb.d/*") ;; 63 | *) logger "$0: ignoring $f" ;; 64 | esac 65 | done 66 | 67 | # Scan for environment variables prefixed with PHP_INI_ENV_ and inject those into ${PHP_INI_DIR}/conf.d/zzz_custom_settings.ini 68 | # Environment variable names cannot contain dots, so use two underscores in that case: 69 | # PHP_INI_ENV_session__gc_maxlifetime=2592000 --> session.gc_maxlifetime=2592000 70 | if [ -f ${PHP_INI_DIR}/conf.d/zzz_custom_settings.ini ]; then rm ${PHP_INI_DIR}/conf.d/zzz_custom_settings.ini; fi 71 | env | while IFS='=' read -r name value ; do 72 | if (echo $name|grep -E "^PHP_INI_ENV">/dev/null); then 73 | # remove PHP_INI_ENV_ prefix 74 | name=`echo $name | cut -f 4- -d "_"` 75 | # Replace __ with . 76 | name=${name//__/.} 77 | echo $name=$value >> ${PHP_INI_DIR}/conf.d/zzz_custom_settings.ini 78 | fi 79 | done 80 | 81 | # Scan for environment variables prefixed with PHP_FPM_INI_ENV_ and inject those into /usr/local/etc/php-fpm.d/zzz_custom_settings.conf 82 | # Environment variable names cannot contain dots, so use two underscores in that case: 83 | # PHP_FPM_INI_ENV_pm__max_children=10 --> pm.max_children=10 84 | if [ -f /usr/local/etc/php-fpm.d/zzz_custom_settings.conf ]; then rm /usr/local/etc/php-fpm.d/zzz_custom_settings.conf; fi 85 | echo '[www]' > /usr/local/etc/php-fpm.d/zzz_custom_settings.conf 86 | env | while IFS='=' read -r name value ; do 87 | if (echo $name|grep -E "^PHP_FPM_INI_ENV">/dev/null); then 88 | # remove PHP_FPM_INI_ENV_ prefix 89 | name=`echo $name | cut -f 5- -d "_"` 90 | # Replace __ with . 91 | name=${name//__/.} 92 | echo $name=$value >> /usr/local/etc/php-fpm.d/zzz_custom_settings.conf 93 | fi 94 | done 95 | 96 | exec "$@" 97 | -------------------------------------------------------------------------------- /php/scripts/wait_for_db.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | getCode() . ' ' . $e->errorInfo . ' ' . $e->getMessage() . "\n"; 60 | if ($try < MAXTRY) sleep(5); 61 | } 62 | } 63 | 64 | echo "ERROR: Max limit reached, not able to connect to ${driver} '${name}', exiting with error code.\n"; 65 | exit(1); 66 | --------------------------------------------------------------------------------