├── .gitignore ├── LICENSE ├── README.md ├── Vagrantfile ├── build.sh ├── create_distro_containers.sh ├── docker-compose.sh ├── docker-compose.yml ├── docker-compose_behat.yml.template ├── docker-compose_build.yml ├── docker-compose_databasedump.yml ├── docker-compose_distribution.yml ├── docker-compose_ezp54.yml ├── docker-compose_ezpinstall.sh ├── docker-compose_ezpinstall.yml ├── docker-compose_ezpinstall_dev.yml ├── docker-compose_ezpinstall_php5.yml ├── docker-compose_php5.yml ├── docker-compose_services-ezp54.yml ├── docker-compose_services.yml ├── docker-compose_services_php5.yml ├── docker-compose_solr.yml.template ├── docker-compose_vagrant-aws.yml ├── docker-compose_vardir.yml ├── docker_commands.txt ├── dockerfiles ├── databasedump │ └── Dockerfile ├── distribution │ └── Dockerfile ├── ezphp │ ├── Dockerfile │ ├── Dockerfile-dev │ ├── Dockerfile-php7 │ ├── config │ │ ├── opcache.ini │ │ ├── xdebug.ini │ │ └── xdebug.ini-ezp54 │ ├── generate_kickstart_file.sh │ ├── generate_parameters_file.sh │ ├── prepare_behat.sh │ ├── prepare_distribution_volume.sh │ └── run.sh ├── internal │ ├── nginx │ │ ├── Dockerfile │ │ └── run.sh │ ├── vagrant-aws │ │ ├── Dockerfile │ │ └── utopic_notes.txt │ ├── varnish │ │ ├── Dockerfile │ │ ├── run.sh │ │ ├── supervisord-base.conf-part │ │ └── varnish4.vcl │ └── varnish_prepare │ │ ├── Dockerfile │ │ └── run.sh └── vardir │ └── Dockerfile ├── files ├── auth.json-EXAMPLE ├── authorized_keys2-EXAMPLE ├── distro_containers.config-EXAMPLE ├── docker-compose.config-EXAMPLE ├── docker-compose.service ├── kickstart.ini.with_demo_content ├── kickstart.ini.without_demo_content ├── user-data-EXAMPLE ├── user-data-EXAMPLE-AWS └── vagrant.yml-EXAMPLE ├── resources ├── database_character_set.sh ├── docker-compose ├── docker-compose_url.txt ├── ezpublish.yml_varnishpurge.diff └── motd_ez_welcome.conf ├── vagrant-aws.sh └── volumes ├── composercache └── .keep ├── ezpublish └── .keep └── mysql └── .keep /.gitignore: -------------------------------------------------------------------------------- 1 | /.vagrant/ 2 | docker-compose_behat.yml 3 | docker-compose_solr.yml 4 | files/vagrant.yml 5 | files/authorized_keys2 6 | files/auth.json 7 | files/user-data 8 | files/docker-compose.config 9 | files/distro_containers.config 10 | files/kickstart_template.ini 11 | volumes/mysql 12 | volumes/ezpublish 13 | volumes/composercache 14 | dockerfiles/ezphp/kickstart_template.ini 15 | dockerfiles/internal/varnish_prepare/ezpublish.yml_varnishpurge.diff 16 | dockerfiles/distribution/ezpublish.tar.gz 17 | dockerfiles/databasedump/ezp.sql 18 | dockerfiles/vardir/vardir.tar.gz 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 1999-2014 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 | 298 | Copyright (C) 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 | , 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 | # eZ Platform, eZ Studio & eZ Publish Platform 5.3+ in Docker 2 | 3 | *Project is work in progress!* 4 | 5 | Aims to provide setup for _eZ Platform_(also implies _eZ Studio_) using Docker containers and Docker Compose, either natively on linux if you have docker and docker-compose installed, or via VM using Vagrant and Virtualbox/AWS. 6 | _Note: The use of Vagrant will probably be faded out in favour of Docker Machine in the future._ 7 | 8 | ## Project goal 9 | 10 | Two things: 11 | - Provide an (eventually) official php image for use with eZ Platform, able to configure itself on startup. On top of that: 12 | - By extended container or otherwise: support for eZ Publish 5.3+ *(fixes will be made on upstream 5.3.x/5.4.x to make this possible)* 13 | - By extended container or otherwise: support debugging/development mode use cases and other PHP versions 14 | - Provide a wide range of docker-compose setups for the different ways to setup eZ Platform, using thirdparty official docker images *(apache, nginx, mysql, mariadb, solr, varnish, memcached, redis, ..)* 15 | 16 | 17 | The docker-compose setups aims to cover specific setups. 18 | And the aim is that the yml files can easily be customized to change version to test for QA/Support/Reproduction needs. 19 | - (default) Single server using mysql: nginx, mariadb 20 | - Cluster using mysql *(sharing volume, so on one machine)*: nginx, mysql, memcached, varnish 21 | - Single server postgres: apache (fastcgi), postgres 22 | 23 | With this everything should be in place for easily evaluating adding postgres cluster support, adding redis support, 24 | shared files system for scalability testing, and much more.. 25 | 26 | 27 | ## Installation 28 | 29 | The containers can be created and started using either vagrant or docker-compose. Vagrant will create a virtual machine where the containers are running while docker-compose will create the containers on host ( requires linux....) 30 | 31 | ### Default system 32 | 33 | By default, the following system will be installed: 34 | - Vagrant will create a virtual machine using VirtualBox. This VM will run CoreOS 35 | - Latest eZ Platform will be installed (any distribution available over *composer create-project* should work) 36 | - eZ Platform will be available on http://33.33.33.53:8080 on the VM 37 | 38 | ### Optional installation steps 39 | 40 | - Copy files/docker-compose.config-EXAMPLE to files/docker-compose.config ( and set the environment variables in files/docker-compose.config according to your needs if you want to change the default setup ). 41 | - Copy files/auth.yml-EXAMPLE to files/auth.yml. 42 | This file has two authentication sections: 43 | - The setting for updates.ez.no is applicable if you want to install eZ Publish Enterprise/eZ Platform LTS/eZ Studio and not the community version 44 | - The setting for github.com is applicable when doing installations via composer ( which is default ). It will raise certain API bandwidth limitations on github. 45 | In order to create a github oauth token, please follow instructions on this page : https://help.github.com/articles/creating-an-access-token-for-command-line-use To revoke access to this github oauth token you can visit https://github.com/settings/applications 46 | - Adding a github oauth token will in most cases INCREASE the performance of the installation process and is therefore HIGHLY recommended. 47 | - Copy files/vagrant.yml-EXAMPLE to files/vagrant.yml. Then adjust settings in .yml file as needed 48 | - If you have an existing ezplatform installation you want to use, do the following : 49 | - Place the installation in volumes/ezpublish 50 | - Make sure EZ_INSTALLTYPE is set to "basic" 51 | - You need to manually import the database from the php-cli container ( see chapter "Running php-cli and mysql commands" ) 52 | This needs to be done after all images and containers has been created ( after you have executed "vagrant up" or "./docker-compose.sh up -d" ) 53 | For convenience, you should also place the database dump in volumes/ezpublish so you may easily access it from the php-cli container 54 | 55 | Note : If you opt not to copy the configurations files mentioned above ( the *.-EXAMPLE files ), the system will do so for you and use default settings. 56 | 57 | 58 | ### AWS specific procedures 59 | 60 | If you want to use an elastic IP you need version 0.5.1 of the vagrant-aws plugin ( currently in development ). The easiest way to do this is to use the provided container. 61 | You may also use this container if you simply do not want to install vagrant on your system. 62 | 63 | In order to create the container image, run : 64 | ```docker build --rm=true --force-rm=true -t ezpublishdocker_vagrantaws:latest dockerfiles/internal/vagrant-aws/``` 65 | 66 | In order to use this image, use the vagrant wrapper instead of using the vagrant installed directly on your system: 67 | ./vagrant-aws.sh [vagrant options] 68 | 69 | Example #1: 70 | ./vagrant-aws.sh up --provider=aws 71 | 72 | Example #2: 73 | ./vagrant-aws.sh up provision 74 | 75 | As you can see, the wrapper will pass on any provided parameters to the vagrant process inside the container. 76 | 77 | 78 | ### Vagrant specific procedures 79 | - Ensure you have the following tools installed on our computer: 80 | - Vagrant 1.6+ (http://vagrantup.com) 81 | - VirtualBox 4.3.12+ (http://www.virtualbox.org) 82 | - If using AWS: Install Vagrant AWS plugin. To install run vagrant ```vagrant plugin install vagrant-aws``` 83 | If using the vagrant container above, this step is not needed 84 | - Copy files/user-data-EXAMPLE (optionally files/user-data-EXAMPLE-AWS ) to files/user-data and provide a discovery token as instructed in the file 85 | - If using AWS : 86 | - In files/vagrant.yml, define "use_aws=true" 87 | - Create a dummy box: ```vagrant box add dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box``` 88 | - You likely want web server to listen on port 80, not port 8080. If so, you need to change "8080:80" into "80:80" in the nginx section in docker-compose.yml ( unfortunately, this cannot be a setting in files/docker-compose.config ) 89 | - Run `vagrant up` 90 | 91 | If you later want to do changes to your docker/vagrant files, you need to stop and remove the corresponding container ```docker stop [containerid]; docker rm [containerid]```, remove the image ```docker rmi [imageid]``` and then run ```vagrant provision``` instead of ```vagrant up``` 92 | 93 | #### IMPORTANT difference between provision on virtualbox vs AWS 94 | When using virtualbox as provisioner, ```vagrant provision``` will *not* rsync your local changes over to the VM. Only a ```vagrant up```will do that. 95 | When using AWS as provisioner, ```vagrant provision``` *will* run rsync. This is likely NOT the behaviour you want as this will overwrite db and ezpublish volumes on AWS machine every time you provision. 96 | To prevent this from happening when provisioning on AWS, use the setting "disable_rsync: yes" in vagrant.yml 97 | 98 | If you do changes in configuration files or docker files you may run this commands in order to sync them the VM: 99 | ```cd ezpublish-docker``` 100 | ```rsync -avq --delete --exclude ".git/" --exclude "volumes/ezpublish/.git/" --exclude ".vagrant" --exclude volumes . core@1.2.3.4:/vagrant``` 101 | 102 | where "1.2.3.4" is the IP if the virtual machine 103 | 104 | Please note that running ```vagrant rsync```will also delete any volumes in VM and instead copy over those you have locally 105 | 106 | ### Specific procedures when running containers on local host, not in VM using Vagrant 107 | - Ensure you have the following tools installed on your computer: 108 | - docker version 1.6 or later ( https://docs.docker.com/installation/ubuntulinux/ ) 109 | - Docker-Compose version 1.3.0 or later ( http://docs.docker.com/compose/install/ ) 110 | - Run `./docker-compose.sh up -d` 111 | 112 | If you later just want to recreate specific images or containers, you then first remove those using `docker rm [container]` and `docker rmi [image]`, and then run 113 | `./docker-compose.sh up -d --no-recreate` 114 | 115 | 116 | ### build.sh 117 | 118 | build.sh will build the "service" images you need in order to run eZ Platform. By "service" image we mean the nginx and php images. No customized db image is currently needed as the official MariaDB docker image is used. 119 | 120 | ### docker-compose_ezpinstall.sh 121 | 122 | docker-compose_ezpinstall.sh is a script which will download eZ Platform via composer and install it in volumes/ezpublish. You may specify parameters to composer using EZ_COMPOSERPARAM variable in files/docker-compose.config. 123 | docker-compose_ezpinstall.sh will automaticly by run when running ```vagrant up``` and ```vagrant provision```. 124 | 125 | ### docker-compose.sh 126 | 127 | docker-compose.sh is a wrapper for docker-compose which also do some internal provisioning. Any command line arguments (except "-c configfile" ) used when starting the wrapper is passed on to docker-compose. 128 | docker-compose.sh also accepts one special argument for specifying a alternative configuration file ( files/docker-compose.config is the default one if "-c ..." is not provided ). 129 | Example : 130 | ```docker-compose.sh --custom-conf files/my_custom_docker-compose.config up -d --no-recreate``` 131 | 132 | ### Access your eZ Platform installation 133 | 134 | When the containers are created, you should be able to browse to eZ Platform setup wizard by going to http://[VM_IP_ADDR]:8080/ if using vagrant and http://localhost:8080/ if running the containers on localhost 135 | 136 | ### Setting up eZ Platform using install script 137 | 138 | It is possible to setup a fresh installation using the install script instead of using the setup wizard. ( If using vagrant, this is done automaticly ) 139 | - Run command : ```docker-compose -f docker-compose.yml run -u ez --rm phpfpm1 /bin/bash -c "php app/console ezplatform:install demo; php app/console cache:clear --env=prod"``` 140 | 141 | FYI : The command above assumes you have ```SYMFONY_ENV=prod``` in files/docker-compose.config. If you use a different setting, adjust the ```--env=....``` parameter accordingly. 142 | You may also substitute "demo" with "demo_clean" if you want to install ezdemo without demo data, or "clean" if only want the very basics. 143 | 144 | 145 | ### Varnish 146 | 147 | These are the steps needed in order to get varnish running 148 | - Set ```VARNISH_ENABLED=yes"```in docker-compose.config. 149 | - Run ```docker-compose.sh up -d``` or ```docker-compose.sh up -d --no-recreate``` as usual 150 | - Run the eZ Publish Setup Wizard 151 | - Start the varnishprepare container in order to configure eZ Publish to use a http cache in app/config/ezplatform.yml : ```docker-compose -f docker-compose[_ubuntu].yml start varnishprepare``` 152 | This varnishprepare container has some requirements: 153 | - Please note that this container must be run *after* setup wizard has been created. If you run it before SW, the `ezplatform.yml` is yet not generated and the varnishprepare container will abort 154 | - In order to inject the settings correctly in `ezplatform.yml`, your `ezplatform.yml` should not differ too much from the standard ezpublish.yml generated by the setup wizard 155 | - Due to the fact mentioned in previous point, this container do not support installations which has been configured using the install script. 156 | - The varnishprepare container assumes your siteaccess group is called "ezdemo_site_clean_group" or "ezdemo_site_group:" ( which is the defaults when installing "Demo site with(out) demo content" ) 157 | - If the varnishprepare container is not able to configure ezplatform correctly on your setup, please follow the instructions in the "Update YML configuration" chapter on https://doc.ez.no/display/EZP/Using+Varnish 158 | - If container do not work as expected, you may inspect the log using ```docker logs ezpublishdocker_varnishprepare_1``` 159 | - The ```docker logs ....``` will output the IP of the varnish container which you need in order to configure ezplatform.yml manually 160 | 161 | 162 | #### SSH 163 | 164 | ##### VM 165 | 166 | To enter virtual machine: 167 | - ```vagrant ssh``` 168 | 169 | From there you can check running containers: 170 | - ```docker ps``` 171 | 172 | And inspect the eZ Publish folder which was rsynced into the vm and is used as volume for `ezpublishvol` container: 173 | - ```ls -al /vagrant/volumes/ezpublish/``` 174 | 175 | 176 | ##### Running php-cli and mysql commands 177 | 178 | To run php/mysql commands you'll need to start a new container which contains php-cli: 179 | - ```vagrant ssh``` 180 | - ```docker run --rm -i -t --link ezpublishdocker_db1_1:db --dns 8.8.8.8 --dns 8.8.4.4 --volumes-from ezpublishdocker_ezpublishvol_1 --volumes-from ezpublishdocker_composercachevol_1 ezpublishdocker_phpcli /bin/bash``` 181 | 182 | If running the containers on localhost, you have to skip the ```vagrant ssh``` of course 183 | 184 | From there you can run symfony commands like normal: 185 | - ```php app/console ezpublish:legacy:assets_install --symlink --relative --env dev`` 186 | 187 | You can also access mysql from this container as it has the mysql client installed: 188 | - ```mysql -uadmin --password=[mysqlpasswd] --protocol=tcp --host=db``` 189 | 190 | Mysql password is defined in files/docker-compose.config 191 | 192 | ( For other environment variables see ```env```, basically these typically comes from parent images and links ) 193 | 194 | To get out, type ```exit``` two times ;) 195 | 196 | ##### Running vagrant from windows 197 | 198 | It is possible to run this from Windows. However, it is not possible to use synced_folder with type virtualbox (seems to be some incompatibility between virtualbox and docker's provision plugin in Vagrant or between CoreOS and Vagrant ? ) 199 | So, you need to use rsync on Windows too. In order to do this, you need rsync and ssh. 200 | Easiest way to accomplish this is to install MinGW ( minimalist GNU for Windows ), http://sourceforge.net/projects/mingw/files/MSYS/Extension/rsync/rsync-3.0.8-1/ 201 | Download wingw-get-setup.exe and install openssh and rsync. You should then add "C:\MinGW\msys\1.0\bin" to your path and you should be all set to run "vagrant up" 202 | 203 | If you have issues getting ssh keys to work with MinGW, this is how to fix that: 204 | 205 | C:\> cd C:\MinGW\msys\1.0 206 | C:\> mkdir home\vl\.ssh 207 | 208 | Substitute 'C:\MinGW\msys\1.0' with your actuall MinGW installation directory. 209 | 210 | ### Tutorials 211 | 212 | #### Installing the system using vagrant 213 | 214 | Make a config file ( recommended, but not strictly speaking ) 215 | ```cp files/docker-compose.config-EXAMPLE files/docker-compose.config``` 216 | 217 | Make a vagrant config file 218 | ```cp files/vagrant.yml-EXAMPLE to files/vagrant.yml``` 219 | 220 | Start vagrant 221 | ```vagrant up``` 222 | 223 | Access the eZ Platform installation. 224 | Access the installation using the url http://33.33.33.53/ 225 | 226 | 227 | 228 | #### Installing on local host without vagrant ( requires docker and docker-compose installed locally ) 229 | 230 | Make a config file ( recommended, but not strictly speaking needed ) 231 | ```cp files/docker-compose.config-EXAMPLE files/docker-compose.config``` 232 | 233 | Create the service images ( web and php images ) 234 | ```./build.sh``` 235 | 236 | Install eZ Platform/Studio: 237 | ```./docker-compose_ezpinstall.sh``` 238 | 239 | Create the containers needed for running eZ Platform/Studio 240 | ```./docker-compose.sh up -d --no-recreate``` 241 | 242 | Run the install script 243 | ```docker-compose -f docker-compose.yml run --rm -u ez phpfpm1 /bin/bash -c "php app/console ezplatform:install demo; php app/console cache:clear --env=prod"``` 244 | 245 | Stop the containers: 246 | ```docker-compose -f docker-compose.yml stop``` 247 | 248 | Remove the containers: 249 | ```docker-compose -f docker-compose.yml rm -v; docker-compose -f docker-compose_ezpinstall.yml rm -v``` 250 | 251 | Remove the images: 252 | ```docker rmi ezsystems/web ezsystems/ezphp ezsystems/ezphp:5.6``` 253 | 254 | Remove the eZ Platform files: 255 | ```sudo rm -rf volumes/ezpublish/* volumes/mysql/*; sudo rm volumes/ezpublish/.travis.yml volumes/ezpublish/.gitignore``` 256 | 257 | 258 | #### Installing ezp 5.4 on local host without vagrant ( requires docker and docker-compose installed locally ) 259 | 260 | Make a config file ( recommended, but not strictly speaking needed ) 261 | ```cp files/docker-compose.config-EXAMPLE files/docker-compose.config``` 262 | 263 | Make sure you have the following setting in ```files/docker-compose.config```: 264 | 265 | EZ_COMPOSERPARAM="--prefer-dist --repository-url=https://updates.ez.no/ttl ezsystems/ezpublish-community /var/www ~5.4.0" 266 | 267 | Create the service images ( web and php images ) 268 | ```./build.sh``` 269 | 270 | Install eZ Platform/Studio: 271 | ```./docker-compose_ezpinstall.sh -f docker-compose_ezpinstall_php5.yml``` 272 | 273 | Create the containers needed for running eZ Platform/Studio using php5 container instead of php7 274 | ```./docker-compose.sh -f docker-compose_ezp54.yml -f docker-compose_php5.yml up -d --no-recreate``` 275 | 276 | Stop the containers: 277 | ```docker-compose -f docker-compose_ezp54.yml -f docker-compose_php5.yml stop``` 278 | 279 | Remove the containers: 280 | ```docker-compose -f docker-compose_ezp54.yml -f docker-compose_php5.yml rm -v; docker-compose -f docker-compose_ezpinstall.yml -f docker-compose_php5.yml rm -v``` 281 | 282 | Remove the images: 283 | ```docker rmi ezsystems/web ezsystems/ezphp ezsystems/ezphp:5.6``` 284 | 285 | Remove the eZ Platform files: 286 | ```sudo rm -rf volumes/ezpublish/* volumes/mysql/*; sudo rm volumes/ezpublish/.travis.yml volumes/ezpublish/.gitignore``` 287 | 288 | 289 | #### Building the distro container 290 | 291 | Make a config file 292 | ```cp files/distro_containers.config-EXAMPLE files/distro_containers.config``` 293 | 294 | Create the service images ( web, db and php images ) 295 | ```./build.sh``` 296 | 297 | Create the containers 298 | ```./create_distro_containers.sh``` 299 | 300 | Start the containers 301 | ```source files/docker-compose.config; docker-compose -f docker-compose_services.yml up -d --no-recreate``` 302 | 303 | Remove all the containers 304 | ``` 305 | docker-compose -f docker-compose_services.yml stop; docker-compose -f docker-compose_services.yml rm -v 306 | ./create_distro_containers.sh --cleanup 307 | ``` 308 | 309 | #### Running behat tests 310 | 311 | Make a config file 312 | ```cp files/distro_containers.config-EXAMPLE files/distro_containers.config``` 313 | 314 | Configure `EZ_COMPOSERPARAM` without `--no-dev` option *(as behat is dev package)*, example: 315 | ```EZ_COMPOSERPARAM="--prefer-source --no-progress --no-interaction ezsystems/ezplatform /var/www dev-master"``` 316 | 317 | Make docker-compose file for behat *(step is temporary until we start to use docker compose extend features)*: 318 | ```cat docker-compose.yml docker-compose_behat.yml.template > docker-compose_behat.yml``` 319 | 320 | Create the service images ( web and php images ) 321 | ```./build.sh``` 322 | 323 | Install eZ Platform/Studio *(Step uses what you specified in `EZ_COMPOSERPARAM`)*: 324 | ```./docker-compose_ezpinstall.sh``` 325 | 326 | Create the containers needed for running eZ Platform/Studio 327 | ```./docker-compose.sh -f docker-compose_behat.yml up -d --no-recreate``` 328 | 329 | Run the eZ Platform/Studio install script, example: 330 | ```docker-compose -f docker-compose_behat.yml run -u ez --rm phpfpm1 /bin/bash -c "php app/console ezplatform:install demo; php app/console cache:clear --env=prod"``` 331 | 332 | Run behat tests, example: 333 | ```./docker-compose.sh -f docker-compose_behat.yml run --rm behatphpcli bin/behat --no-colors --profile demo --suite content``` 334 | 335 | If you need to see what is going on in the browser being used by selenium, this is how: 336 | - Find the name of the selenium container using ```docker ps -a```. ( It is usually called ```ezpublishdocker_selenium_1``` ) 337 | - Find the IP address of the selenium container using ```docker inspect ezpublishdocker_selenium_1```. Look under NetworkSettings-->IPAddress 338 | - Enter the container using ```docker exec -t -i ezpublishdocker_selenium_1 /bin/bash``` and issue the following commands: 339 | - ```sudo apt-get update``` 340 | - ```sudo apt-get install x11vnc``` 341 | - ```x11vnc -display :99``` 342 | - If you run the containers on a remote server but want to see the X session on your local display, port-forward the container's port 5900 to localhost : 343 | - ```ssh remoteserver.example.com -L 5900:172.17.27.159:5900``` ( where you substitute "172.17.27.159" with the actuall IP of the selenium container ) 344 | - Start vncviewer on your computer : ```vncviewer localhost:5900``` 345 | 346 | 347 | #### Running eZ Platform/Studio with solr 348 | 349 | Make a config file ( recommended, but not strictly speaking ) 350 | ```cp files/docker-compose.config-EXAMPLE files/docker-compose.config``` 351 | 352 | Make docker-compose file for solr: 353 | ```cat docker-compose.yml docker-compose_solr.yml.template > docker-compose_solr.yml``` 354 | 355 | Enable solr link for phpfpm1 service 356 | Edit `docker-compose_solr.yml` and uncomment `# - solr1:solr` in the `phpfpm1:` section. 357 | 358 | Create the service images ( web and php images ) 359 | ```./build.sh``` 360 | 361 | Install eZ Platform/Studio: 362 | ```./docker-compose_ezpinstall.sh``` 363 | 364 | Create the containers needed for running eZ Platform/Studio 365 | ```./docker-compose.sh -f docker-compose_solr.yml up -d --no-recreate``` 366 | 367 | Run the install script 368 | ```docker-compose -f docker-compose_solr.yml run -u ez --rm phpfpm1 /bin/bash -c "php app/console ezplatform:install demo; php app/console cache:clear --env=prod"``` 369 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | require 'yaml' 5 | 6 | if !File.exist?( "files/vagrant.yml" ) 7 | FileUtils.cp( "files/vagrant.yml-EXAMPLE", "files/vagrant.yml" ) 8 | end 9 | vagrantConfig = YAML::load_file( "files/vagrant.yml" ) 10 | 11 | CLOUD_CONFIG_PATH = "files/user-data" 12 | 13 | Vagrant.configure("2") do |config| 14 | # AWS specific configuration 15 | 16 | if vagrantConfig['aws']['use_aws'] 17 | config.vm.box = "dummy" 18 | 19 | config.vm.provider :aws do |aws, override| 20 | # key for the Vagrant AWS user 21 | aws.access_key_id = vagrantConfig['aws']['access_key_id'] 22 | aws.secret_access_key = vagrantConfig['aws']['secret_access_key'] 23 | 24 | aws.region = vagrantConfig['aws']['region'] 25 | aws.instance_type = vagrantConfig['aws']['instance_type'] 26 | 27 | aws.subnet_id = vagrantConfig['aws']['subnet_id'] 28 | aws.associate_public_ip = vagrantConfig['aws']['associate_public_ip'] 29 | aws.elastic_ip = vagrantConfig['aws']['elastic_ip'] 30 | 31 | aws.security_groups = vagrantConfig['aws']['security_groups'] 32 | 33 | aws.ami = vagrantConfig['aws']['ami'] 34 | # SSH login credentials 35 | aws.keypair_name = vagrantConfig['aws']['keypair_name'] 36 | 37 | aws.block_device_mapping = [{ 'DeviceName' => vagrantConfig['aws']['block_device_mapping']['device_name'], 'Ebs.VolumeSize' => vagrantConfig['aws']['block_device_mapping']['volume_size'] }] 38 | 39 | if File.exist?(CLOUD_CONFIG_PATH) 40 | aws.user_data = File.read( CLOUD_CONFIG_PATH ); 41 | end 42 | 43 | override.ssh.private_key_path = "files/vagrant.pem" 44 | override.ssh.username = "core" # should be "admin" for debian images 45 | end 46 | end 47 | 48 | if !vagrantConfig['aws']['use_aws'] 49 | # VirtualBox specific configuration 50 | 51 | config.vm.box = "coreos-%s" % vagrantConfig['virtualmachine']['coreos_channel'] 52 | config.vm.box_version = ">= 681.0.0" 53 | config.vm.box_url = "http://%s.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json" % vagrantConfig['virtualmachine']['coreos_channel'] 54 | 55 | if File.exist?(CLOUD_CONFIG_PATH) 56 | config.vm.provision :file, :source => "#{CLOUD_CONFIG_PATH}", :destination => "/tmp/vagrantfile-user-data" 57 | config.vm.provision :shell, :inline => "mv /tmp/vagrantfile-user-data /var/lib/coreos-vagrant/", :privileged => true 58 | end 59 | 60 | config.vm.provider :virtualbox do |vb, override| 61 | vb.check_guest_additions = false 62 | vb.functional_vboxsf = false 63 | vb.gui = false 64 | vb.memory = vagrantConfig['virtualmachine']['ram'] 65 | vb.cpus = vagrantConfig['virtualmachine']['cpus'] 66 | vb.customize ["modifyvm", :id, "--ostype", "Linux26_64"] 67 | end 68 | end 69 | 70 | if !File.exist?( "files/docker-compose.config" ) 71 | FileUtils.cp( "files/docker-compose.config-EXAMPLE", "files/docker-compose.config" ) 72 | end 73 | 74 | # Set the Timezone to something useful 75 | config.vm.provision :shell, :inline => "echo \"" + vagrantConfig['virtualmachine']['timezone'] + "\" | sudo tee /etc/timezone" 76 | 77 | if vagrantConfig['debug']['copy_authorized_keys2'] == true 78 | ssh_authorized_keys_file = File.read( "files/authorized_keys2" ) 79 | config.vm.provision :shell, :inline => " 80 | echo 'Copying SSH authorized_keys2 to VM for provisioning...' ; \ 81 | mkdir -m 700 -p /root/.ssh ; \ 82 | echo '#{ssh_authorized_keys_file }' > /root/.ssh/authorized_keys2 && chmod 600 /root/.ssh/authorized_keys2 83 | " 84 | config.vm.provision :shell, :inline => " 85 | echo '#{ssh_authorized_keys_file }' > /home/core/.ssh/authorized_keys2 && chmod 600 /home/core/.ssh/authorized_keys2 && chown core:core /home/core/.ssh/authorized_keys2 86 | " 87 | end 88 | 89 | if vagrantConfig['debug']['disable_rsync'] == false 90 | config.vm.synced_folder ".", "/vagrant", type: "rsync", 91 | rsync__exclude: [ ".git/", "volumes/ezpublish/.git/"], 92 | rsync__auto: true 93 | else 94 | config.vm.synced_folder ".", "/vagrant", type: "rsync", 95 | disabled: true 96 | end 97 | 98 | # Install docker-compose on vagrant machine 99 | config.vm.provision :shell, :inline => " 100 | if [ ! -f /opt/bin/docker-compose ]; then \ 101 | mkdir -p /opt/bin 102 | cp /vagrant/resources/docker-compose /opt/bin 103 | chmod +x /opt/bin/docker-compose 104 | fi 105 | " 106 | 107 | if vagrantConfig['debug']['disable_docker_provision'] == false 108 | config.vm.provision :shell, :inline => ' 109 | cd /vagrant; \ 110 | export COMPOSE_PROJECT_NAME=ezpublishdocker 111 | source files/docker-compose.config-EXAMPLE 112 | source files/docker-compose.config 113 | 114 | cd /vagrant 115 | ./build.sh 116 | ./docker-compose_ezpinstall.sh 117 | ./docker-compose.sh up -d --no-recreate 118 | # We will not run setup if ezpublish_legacy exists. Then user might want to run setup wizard 119 | if [ ! -d volumes/ezpublish/ezpublish_legacy ]; then \ 120 | APP_FOLDER="app" 121 | if [ -d volumes/ezpublish ]; then 122 | APP_FOLDER="ezpublish" 123 | 124 | # Let us wait for db, and Solr.., containers to get started and ready 125 | echo "Now waiting 20 seconds for database and Solr to be fully booted before installing eZ Platform data!" 126 | sleep 20 127 | echo "Install eZ Platform demo data" 128 | ${COMPOSE_EXECUTION_PATH}docker-compose -f docker-compose.yml run -u ez --rm phpfpm1 /bin/bash -c "php $APP_FOLDER/console --env=$SYMFONY_ENV ezplatform:install clean; php $APP_FOLDER/console --env=$SYMFONY_ENV cache:clear" 129 | ${COMPOSE_EXECUTION_PATH}docker-compose -f docker-compose.yml run -u ez --rm phpfpm1 /bin/bash -c "php $APP_FOLDER/console --env=$SYMFONY_ENV cache:warmup" 130 | fi 131 | ' 132 | end 133 | 134 | # Make sure containers starts automatically on boot 135 | config.vm.provision :shell, :inline => " 136 | sudo cp /vagrant/files/docker-compose.service /etc/systemd/system/ 137 | sudo systemctl enable /etc/systemd/system/docker-compose.service 138 | " 139 | 140 | # Add welcome/help text to VM ssh login 141 | config.vm.provision :shell, :inline => " 142 | if [ ! -d /etc/motd.d ] ; then sudo mkdir /etc/motd.d ; fi 143 | sudo cp /vagrant/resources/motd_ez_welcome.conf /etc/motd.d/motd_ez_welcome.conf 144 | " 145 | 146 | config.vm.network :forwarded_port, guest: 80, host: 8080 147 | config.vm.network :private_network, ip: vagrantConfig['virtualmachine']['network']['private_network_ip'] 148 | config.vm.network "public_network" 149 | 150 | config.vm.hostname = vagrantConfig['virtualmachine']['hostname'] 151 | 152 | # Vagrant plugin conflict with coreos 153 | if Vagrant.has_plugin?("vagrant-vbguest") then 154 | config.vbguest.auto_update = false 155 | end 156 | 157 | end 158 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export COMPOSE_PROJECT_NAME=ezpublishdocker 4 | CONFIGFILE=files/docker-compose.config 5 | CMDPARAMETERS="$@" 6 | 7 | # Check for parameter "-c alternative-config.file.config" 8 | function set_composeconfig 9 | { 10 | local value 11 | value=0 12 | 13 | CMDPARAMETERS="" 14 | 15 | for i in "$@"; do 16 | if [ $i == "-c" ]; then 17 | value=1 18 | continue 19 | fi 20 | if [ $value == 1 ]; then 21 | value=0 22 | CONFIGFILE=$i 23 | echo Config file overriden. Using $CONFIGFILE instead 24 | continue 25 | fi 26 | CMDPARAMETERS="$CMDPARAMETERS $i" 27 | done 28 | } 29 | 30 | function build 31 | { 32 | ./docker-compose.sh $CONFIGFILEPARAM -f docker-compose_build.yml build --no-cache 33 | } 34 | 35 | function tag 36 | { 37 | docker tag ${COMPOSE_PROJECT_NAME}_web:latest ezsystems/web:latest 38 | docker tag ${COMPOSE_PROJECT_NAME}_ezphp5:latest ezsystems/ezphp:5.6 39 | docker tag ${COMPOSE_PROJECT_NAME}_ezphp:latest ezsystems/ezphp:latest 40 | } 41 | 42 | function remove_project_tags 43 | { 44 | docker rmi ${COMPOSE_PROJECT_NAME}_web 45 | docker rmi ${COMPOSE_PROJECT_NAME}_ezphp5 46 | docker rmi ${COMPOSE_PROJECT_NAME}_ezphp 47 | } 48 | 49 | set_composeconfig "$@" 50 | 51 | # Load default settings 52 | source files/docker-compose.config-EXAMPLE 53 | 54 | # Load custom settings 55 | source $CONFIGFILE 56 | 57 | if [ $CONFIGFILE == "files/docker-compose.config" ]; then 58 | CONFIGFILEPARAM="" 59 | else 60 | CONFIGFILEPARAM="--custom-conf $CONFIGFILE " 61 | fi 62 | 63 | 64 | 65 | build 66 | tag 67 | remove_project_tags 68 | -------------------------------------------------------------------------------- /create_distro_containers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # usage : ./create_distro_containers.sh [--skip-rebuilding-ezp] [ --target ezstudio ] 6 | # --push : Pushes the created images to a repository 7 | # --pushonly : Only pushes the created images to a repository. In order to make this work, you need to first run this script without the --push or --pushonly parameter 8 | # --install-type [ type ]: Install type used when running installer. Typicall values for type is "clean" and "demo" 9 | # --skip-rebuilding-ezp : Assumes ezpublish.tar.gz is already created and will not generate one using the fig_ezpinstall.sh script 10 | # --skip-running-install-script : Skip running the installer ( php app/console ezplatform:install ... ) 11 | # --target ezstudio : Create ezstudio containers instead of ezplatform 12 | 13 | export COMPOSE_PROJECT_NAME=ezpublishdocker 14 | source files/distro_containers.config 15 | MAINCOMPOSE="docker-compose.yml" 16 | EZPINSTALLCOMPOSE="" 17 | DATE=`date +%Y%m%d` 18 | CONFIGFILE="" 19 | PUSH="false" 20 | PUSHONLY="false" 21 | REBUILD_EZP="true" 22 | INSTALL_TYPE="demo" 23 | RUN_INSTALL_SCRIPT="true" 24 | BUILD_TARGET="ezplatform" # Could be "ezplatform" or "ezstudio" 25 | ONLYCLEANUP="false" 26 | 27 | # Let's try to connect to db for 2 minutes ( 24 * 5 sec intervalls ) 28 | MAXTRY=24 29 | 30 | function parse_commandline_arguments 31 | { 32 | # Based on http://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash, comment by Shane Day answered Jul 1 '14 at 1:20 33 | while [ -n "$1" ]; do 34 | # Copy so we can modify it (can't modify $1) 35 | OPT="$1" 36 | # Detect argument termination 37 | if [ x"$OPT" = x"--" ]; then 38 | shift 39 | for OPT ; do 40 | REMAINS="$REMAINS \"$OPT\"" 41 | done 42 | break 43 | fi 44 | # Parse current opt 45 | while [ x"$OPT" != x"-" ] ; do 46 | case "$OPT" in 47 | # Handle --flag=value opts like this 48 | # -c=* | --config=* ) 49 | # CONFIGFILE="${OPT#*=}" 50 | # shift 51 | # ;; 52 | # # and --flag value opts like this 53 | -c* | --config ) 54 | CONFIGFILE="$2" 55 | shift 56 | ;; 57 | -e* | --ezp54 ) 58 | EZPINSTALLCOMPOSE="-f docker-compose_ezpinstall_php5.yml" 59 | MAINCOMPOSE="$MAINCOMPOSE -f docker-compose_php5.yml" 60 | ;; 61 | -p* | --push ) 62 | PUSH="true" 63 | ;; 64 | -p* | --pushonly ) 65 | PUSH="true" 66 | PUSHONLY="true" 67 | ;; 68 | -s* | --skip-rebuilding-ezp ) 69 | REBUILD_EZP="false" 70 | ;; 71 | -i* | --skip-running-install-script ) 72 | RUN_INSTALL_SCRIPT="false" 73 | ;; 74 | -s* | --install-type ) 75 | INSTALL_TYPE="$2" 76 | shift 77 | ;; 78 | -t* | --target ) 79 | BUILD_TARGET="$2" 80 | shift 81 | ;; 82 | -z* | --cleanup ) 83 | ONLYCLEANUP="true" 84 | ;; 85 | # Anything unknown is recorded for later 86 | * ) 87 | REMAINS="$REMAINS \"$OPT\"" 88 | break 89 | ;; 90 | esac 91 | # Check for multiple short options 92 | # NOTICE: be sure to update this pattern to match valid options 93 | NEXTOPT="${OPT#-[st]}" # try removing single short opt 94 | if [ x"$OPT" != x"$NEXTOPT" ] ; then 95 | OPT="-$NEXTOPT" # multiple short opts, keep going 96 | else 97 | break # long form, exit inner loop 98 | fi 99 | done 100 | # Done with that param. move to next 101 | shift 102 | done 103 | # Set the non-parameters back into the positional parameters ($1 $2 ..) 104 | eval set -- $REMAINS 105 | 106 | if [ "$BUILD_TARGET" != "ezstudio" ] && [ "$BUILD_TARGET" != "ezplatform" ] ; then 107 | echo "Invalid target : $BUILD_TARGET" 108 | exit 109 | fi 110 | echo "REBUILD_EZP=$REBUILD_EZP" 111 | echo "BUILD_TARGET=$BUILD_TARGET" 112 | } 113 | 114 | function getAppFolder 115 | { 116 | APP_FOLDER="app" 117 | if [ -d volumes/ezpublish/ezpublish ]; then 118 | APP_FOLDER="ezpublish" 119 | fi 120 | echo "App folder found : $APP_FOLDER" 121 | } 122 | 123 | function prepare 124 | { 125 | ${COMPOSE_EXECUTION_PATH}docker-compose -f $MAINCOMPOSE kill 126 | ${COMPOSE_EXECUTION_PATH}docker-compose -f $MAINCOMPOSE rm --force -v 127 | 128 | ${COMPOSE_EXECUTION_PATH}docker-compose -f docker-compose_distribution.yml kill 129 | ${COMPOSE_EXECUTION_PATH}docker-compose -f docker-compose_distribution.yml rm --force -v 130 | 131 | ${COMPOSE_EXECUTION_PATH}docker-compose -f docker-compose_vardir.yml kill 132 | ${COMPOSE_EXECUTION_PATH}docker-compose -f docker-compose_vardir.yml rm --force -v 133 | 134 | ${COMPOSE_EXECUTION_PATH}docker-compose -f docker-compose_databasedump.yml kill 135 | ${COMPOSE_EXECUTION_PATH}docker-compose -f docker-compose_databasedump.yml rm --force -v 136 | 137 | ${COMPOSE_EXECUTION_PATH}docker-compose -f docker-compose_ezpinstall.yml $EZPINSTALLCOMPOSE kill 138 | ${COMPOSE_EXECUTION_PATH}docker-compose -f docker-compose_ezpinstall.yml $EZPINSTALLCOMPOSE rm --force -v 139 | docker rmi ${COMPOSE_PROJECT_NAME}_ezpinstall || /bin/true 140 | 141 | docker rmi ${COMPOSE_PROJECT_NAME}_distribution:latest || /bin/true 142 | docker rmi ${DOCKER_REPOSITORY}/${DOCKER_USER}/${BUILD_TARGET}_distribution:${DOCKER_BUILDVER} || /bin/true 143 | docker rmi ${COMPOSE_PROJECT_NAME}_vardir:latest || /bin/true 144 | docker rmi ${DOCKER_REPOSITORY}/${DOCKER_USER}/${BUILD_TARGET}_vardir:${DOCKER_BUILDVER} || /bin/true 145 | docker rmi ${COMPOSE_PROJECT_NAME}_databasedump:latest || /bin/true 146 | docker rmi ${DOCKER_REPOSITORY}/${DOCKER_USER}/${BUILD_TARGET}_databasedump:${DOCKER_BUILDVER} || /bin/true 147 | 148 | 149 | if [ $REBUILD_EZP == "true" ]; then 150 | sudo rm -rf volumes/ezpublish volumes/mysql || /bin/true 151 | mkdir volumes/ezpublish volumes/mysql 152 | touch volumes/mysql/.keep 153 | fi 154 | rm -f dockerfiles/distribution/ezpublish.tar.gz 155 | 156 | if [ $ONLYCLEANUP == "true" ]; then 157 | echo exiting 158 | exit 159 | fi 160 | } 161 | 162 | function install_ezpublish 163 | { 164 | if [ $REBUILD_EZP == "true" ]; then 165 | if [ "$CONFIGFILE" == "" ]; then 166 | ./docker-compose_ezpinstall.sh $EZPINSTALLCOMPOSE 167 | else 168 | ./docker-compose_ezpinstall.sh $EZPINSTALLCOMPOSE -c $CONFIGFILE 169 | fi 170 | else 171 | # Workaround since ezphp container is not defined in docker-compose.yml 172 | YMLFILE="docker-compose_ezpinstall.yml" 173 | if [ "$SYMFONY_ENV" = "dev" ]; then 174 | YMLFILE="docker-compose_ezpinstall_dev.yml" 175 | fi 176 | ${COMPOSE_EXECUTION_PATH}docker-compose -f $YMLFILE build 177 | fi 178 | } 179 | 180 | function waitForDatabaseToGetUp 181 | { 182 | local DBUP 183 | local TRY 184 | DBUP=false 185 | TRY=1 186 | while [ $DBUP == "false" ]; do 187 | echo "Checking if mysql is up yet, attempt :$TRY" 188 | docker-compose -f docker-compose.yml run -u ez --rm phpfpm1 /bin/bash -c 'echo "show databases" | mysql -u$DB_ENV_MYSQL_USER -p$DB_ENV_MYSQL_PASSWORD $DB_ENV_MYSQL_DATABASE -h db > /dev/null' && DBUP="true" 189 | 190 | let TRY=$TRY+1 191 | if [ $TRY -eq $MAXTRY ]; then 192 | echo Max limit reached. Not able to connect to mysql. Running installer will likely fail 193 | DBUP="true" 194 | else 195 | sleep 5; 196 | fi 197 | done 198 | } 199 | 200 | function run_installscript 201 | { 202 | if [ $RUN_INSTALL_SCRIPT == "false" ]; then 203 | return 0 204 | fi 205 | 206 | #Start service containers and wait some seconds for mysql to get running 207 | #FIXME : can be removed now? 208 | ${COMPOSE_EXECUTION_PATH}docker-compose -f $MAINCOMPOSE up -d # We must call "up" before "run", or else volumes definitions in .yml will not be treated correctly ( will mount all volumes in vfs/ folder ) ( must be a docker-compose bug ) 209 | waitForDatabaseToGetUp 210 | # sleep 12 211 | 212 | if [ $REBUILD_EZP == "true" ]; then 213 | ${COMPOSE_EXECUTION_PATH}docker-compose -f $MAINCOMPOSE run -u ez --rm phpfpm1 /bin/bash -c "php $APP_FOLDER/console --env=prod ezplatform:install $INSTALL_TYPE && php $APP_FOLDER/console cache:clear --env=prod" 214 | fi 215 | } 216 | 217 | function warm_cache 218 | { 219 | ${COMPOSE_EXECUTION_PATH}docker-compose -f $MAINCOMPOSE run -u ez --rm phpfpm1 /bin/bash -c "php $APP_FOLDER/console cache:warmup --env=prod" 220 | } 221 | 222 | function create_distribution_tarball 223 | { 224 | sudo tar -czf dockerfiles/distribution/ezpublish.tar.gz --directory volumes/ezpublish --exclude "./$APP_FOLDER/cache/*" --exclude "./$APP_FOLDER/logs/*" --exclude './web/var/*' . 225 | sudo chown `whoami`: dockerfiles/distribution/ezpublish.tar.gz 226 | } 227 | 228 | function create_distribution_container 229 | { 230 | docker-compose -f docker-compose_distribution.yml up -d 231 | } 232 | 233 | function tag_distribution_container 234 | { 235 | echo "Tagging image : ${DOCKER_REPOSITORY}/${DOCKER_USER}/${BUILD_TARGET}_distribution:${DOCKER_BUILDVER}" 236 | docker tag ${COMPOSE_PROJECT_NAME}_distribution:latest ${DOCKER_REPOSITORY}/${DOCKER_USER}/${BUILD_TARGET}_distribution:${DOCKER_BUILDVER} 237 | } 238 | 239 | function push_distribution_container 240 | { 241 | if [ $PUSH == "true" ]; then 242 | echo "Pushing image : ${DOCKER_REPOSITORY}/${DOCKER_USER}/${BUILD_TARGET}_distribution:${DOCKER_BUILDVER}" 243 | docker push ${DOCKER_REPOSITORY}/${DOCKER_USER}/${BUILD_TARGET}_distribution:${DOCKER_BUILDVER} 244 | fi 245 | } 246 | 247 | function create_vardir_tarball 248 | { 249 | sudo tar -czf dockerfiles/vardir/vardir.tar.gz --directory volumes/ezpublish/web var 250 | sudo chown `whoami`: dockerfiles/vardir/vardir.tar.gz 251 | } 252 | 253 | function create_vardir_container 254 | { 255 | docker-compose -f docker-compose_vardir.yml up -d 256 | } 257 | 258 | function tag_vardir_container 259 | { 260 | echo "Tagging image : ${DOCKER_REPOSITORY}/${DOCKER_USER}/${BUILD_TARGET}_vardir:${DOCKER_BUILDVER}" 261 | docker tag ${COMPOSE_PROJECT_NAME}_vardir:latest ${DOCKER_REPOSITORY}/${DOCKER_USER}/${BUILD_TARGET}_vardir:${DOCKER_BUILDVER} 262 | } 263 | 264 | function push_vardir_container 265 | { 266 | if [ $PUSH == "true" ]; then 267 | echo "Pushing image : ${DOCKER_REPOSITORY}/${DOCKER_USER}/${BUILD_TARGET}_vardir:${DOCKER_BUILDVER}" 268 | docker push ${DOCKER_REPOSITORY}/${DOCKER_USER}/${BUILD_TARGET}_vardir:${DOCKER_BUILDVER} 269 | fi 270 | } 271 | 272 | function create_mysql_tarball 273 | { 274 | ${COMPOSE_EXECUTION_PATH}docker-compose -f $MAINCOMPOSE run -u ez phpfpm1 /bin/bash -c "mysqldump -u ezp -p${MYSQL_PASSWORD} -h db ezp > /tmp/ezp.sql" 275 | docker cp ${COMPOSE_PROJECT_NAME}_phpfpm1_run_1:/tmp/ezp.sql dockerfiles/databasedump 276 | docker rm ${COMPOSE_PROJECT_NAME}_phpfpm1_run_1 277 | } 278 | 279 | function create_mysql_container 280 | { 281 | ${COMPOSE_EXECUTION_PATH}docker-compose -f docker-compose_databasedump.yml up -d 282 | } 283 | 284 | function tag_mysql_container 285 | { 286 | echo "Tagging image : ${DOCKER_REPOSITORY}/${DOCKER_USER}/${BUILD_TARGET}_databasedump:${DOCKER_BUILDVER}" 287 | docker tag ${COMPOSE_PROJECT_NAME}_databasedump:latest ${DOCKER_REPOSITORY}/${DOCKER_USER}/${BUILD_TARGET}_databasedump:${DOCKER_BUILDVER} 288 | } 289 | 290 | function push_mysql_container 291 | { 292 | if [ $PUSH == "true" ]; then 293 | echo "Pushing image : ${DOCKER_REPOSITORY}/${DOCKER_USER}/${BUILD_TARGET}_databasedump:${DOCKER_BUILDVER}" 294 | docker push ${DOCKER_REPOSITORY}/${DOCKER_USER}/${BUILD_TARGET}_databasedump:${DOCKER_BUILDVER} 295 | fi 296 | } 297 | 298 | function create_initialize_container 299 | { 300 | ${COMPOSE_EXECUTION_PATH}docker-compose -f docker-compose_initialize.yml up -d 301 | } 302 | 303 | function pushonly 304 | { 305 | if [ "$PUSHONLY" == "true" ]; then 306 | echo push_distribution_container 307 | push_distribution_container 308 | 309 | echo push_vardir_container 310 | push_vardir_container 311 | 312 | echo push_mysql_container 313 | push_mysql_container 314 | exit 315 | fi 316 | } 317 | 318 | echo parse_commandline_arguments 319 | parse_commandline_arguments "$@" 320 | 321 | echo pushonly: 322 | pushonly 323 | 324 | echo Prepare: 325 | prepare 326 | 327 | echo install_ezpublish: 328 | install_ezpublish 329 | 330 | echo getAppFolder: 331 | getAppFolder 332 | 333 | echo run_installscript: 334 | run_installscript 335 | 336 | echo warm_cache: 337 | warm_cache 338 | 339 | echo create_distribution_tarball 340 | create_distribution_tarball 341 | 342 | echo create_distribution_container 343 | create_distribution_container 344 | 345 | echo tag_distribution_container 346 | tag_distribution_container 347 | 348 | echo push_distribution_container 349 | push_distribution_container 350 | 351 | echo create_vardir_tarball 352 | create_vardir_tarball 353 | 354 | echo create_vardir_container 355 | create_vardir_container 356 | 357 | echo tag_vardir_container 358 | tag_vardir_container 359 | 360 | echo push_vardir_container 361 | push_vardir_container 362 | 363 | echo create_mysql_tarball 364 | create_mysql_tarball 365 | 366 | echo create_mysql_container 367 | create_mysql_container 368 | 369 | echo tag_mysql_container 370 | tag_mysql_container 371 | 372 | echo push_mysql_container 373 | push_mysql_container 374 | -------------------------------------------------------------------------------- /docker-compose.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export COMPOSE_PROJECT_NAME=ezpublishdocker 4 | CONFIGFILE=files/docker-compose.config 5 | CMDPARAMETERS="$@" 6 | 7 | # Check for parameter "-c alternative-config.file.config" 8 | function set_composeconfig 9 | { 10 | local value 11 | value=0 12 | 13 | CMDPARAMETERS="" 14 | 15 | for i in "$@"; do 16 | if [ "$i" == "--custom-conf" ]; then 17 | value=1 18 | continue 19 | fi 20 | if [ $value == 1 ]; then 21 | value=0 22 | CONFIGFILE=$i 23 | echo Config file overriden. Using $CONFIGFILE instead 24 | continue 25 | fi 26 | CMDPARAMETERS="$CMDPARAMETERS $i" 27 | done 28 | } 29 | 30 | set_composeconfig "$@" 31 | 32 | # Load default settings 33 | source files/docker-compose.config-EXAMPLE 34 | 35 | # Load custom settings 36 | source $CONFIGFILE 37 | 38 | 39 | # If {COMPOSE_EXECUTION_PATH} is not set and docker-compose is not in path, we'll test if it is located in /opt/bin. Needed for systemd service 40 | if [ aa$COMPOSE_EXECUTION_PATH == "aa" ]; then 41 | if [ ! `which ${COMPOSE_EXECUTION_PATH}docker-compose > /dev/null` ]; then 42 | if [ -x "/opt/bin/docker-compose" ]; then 43 | COMPOSE_EXECUTION_PATH="/opt/bin/" 44 | fi 45 | fi 46 | fi 47 | 48 | cp -f resources/ezpublish.yml_varnishpurge.diff dockerfiles/internal/varnish_prepare/ 49 | 50 | # Make a argumentlist where any "-d" is removed 51 | for i in $CMDPARAMETERS; do 52 | if [ $i != "-d" ]; then 53 | arglistnodetach="$arglistnodetach $i" 54 | fi 55 | done 56 | 57 | ${COMPOSE_EXECUTION_PATH}docker-compose $CMDPARAMETERS 58 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | # Default container setup 2 | # Simple single server setup 3 | # Uses Debian Jessie and official images when possible 4 | 5 | 6 | dbvol: 7 | image: debian:jessie 8 | volumes: 9 | - ./volumes/mysql:/var/lib/mysql 10 | 11 | ezpublishvol: 12 | image: debian:jessie 13 | volumes: 14 | - ./volumes/ezpublish:/var/www 15 | 16 | db1: 17 | image: mariadb:latest 18 | volumes_from: 19 | - dbvol 20 | volumes: 21 | - ./resources/database_character_set.sh:/docker-entrypoint-initdb.d/database_character_set.sh 22 | environment: 23 | - MYSQL_ROOT_PASSWORD=mysecretrootpassword 24 | - MYSQL_USER=ezp 25 | - MYSQL_PASSWORD 26 | - MYSQL_DATABASE=ezp 27 | - TERM=dumb 28 | 29 | phpfpm1: 30 | # docker compose does not allow to specify container name, this is what it generates, might be fixed in 1.3 31 | image: ezsystems/ezphp 32 | links: 33 | - db1:db 34 | # - solr1:solr 35 | volumes_from: 36 | - ezpublishvol 37 | environment: 38 | - EZ_KICKSTART 39 | - EZ_KICKSTART_FROM_TEMPLATE 40 | - EZ_MAILER_TRANSPORT 41 | - EZ_MAILER_HOST 42 | - EZ_MAILER_USER 43 | - EZ_MAILER_PASSWORD 44 | - SYMFONY_ENV 45 | - MYSQL_PASSWORD 46 | 47 | web1: 48 | image: nginx 49 | links: 50 | - phpfpm1:php_fpm 51 | volumes_from: 52 | - ezpublishvol 53 | ports: 54 | - "8080:80" 55 | environment: 56 | - SYMFONY_ENV 57 | - BASEDIR=/var/www 58 | - MAX_BODY_SIZE=20 59 | - FASTCGI_PASS=php_fpm:9000 60 | - TIMEOUT=190 61 | - VARNISH_ENABLED 62 | - DOCKER0NET 63 | command: /bin/bash -c "cd /var/www && cp -a doc/nginx/ez_params.d /etc/nginx && bin/vhost.sh --template-file=doc/nginx/vhost.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'" 64 | 65 | # 66 | #varnish: 67 | # build: dockerfiles/internal/varnish 68 | # links: 69 | # - phpfpm:php_fpm 70 | # - nginx:nginx 71 | # volumes_from: 72 | # - ezpublishvol 73 | # ports: 74 | # - "8081:80" 75 | # environment: 76 | # - VARNISH_ENABLED 77 | -------------------------------------------------------------------------------- /docker-compose_behat.yml.template: -------------------------------------------------------------------------------- 1 | selenium: 2 | image: selenium/standalone-chrome-debug:3.4.0 3 | links: 4 | - web1:web 5 | ports: 6 | - "9999:9999" 7 | - "4444:4444" 8 | environment: 9 | - SCREEN_WIDTH=1920 10 | - SCREEN_HEIGHT=1080 11 | - SCREEN_DEPTH=24 12 | # Because of: https://github.com/elgalu/docker-selenium/issues/20 13 | shm_size: 256m 14 | 15 | behatphpcli: 16 | image: ezsystems/ezphp 17 | user: ez 18 | links: 19 | - db1:db 20 | - web1:web 21 | - selenium:selenium 22 | volumes_from: 23 | - ezpublishvol 24 | command: "/prepare_behat.sh" 25 | 26 | -------------------------------------------------------------------------------- /docker-compose_build.yml: -------------------------------------------------------------------------------- 1 | 2 | ezphp5: 3 | build: dockerfiles/ezphp 4 | 5 | ezphp: 6 | build: dockerfiles/ezphp 7 | dockerfile: Dockerfile-php7 8 | 9 | web: 10 | build: dockerfiles/internal/nginx 11 | -------------------------------------------------------------------------------- /docker-compose_databasedump.yml: -------------------------------------------------------------------------------- 1 | databasedump: 2 | build: dockerfiles/databasedump 3 | 4 | -------------------------------------------------------------------------------- /docker-compose_distribution.yml: -------------------------------------------------------------------------------- 1 | distribution: 2 | build: dockerfiles/distribution 3 | # volumes: 4 | # - volumes/ezpublish:/var/www_source 5 | 6 | -------------------------------------------------------------------------------- /docker-compose_ezp54.yml: -------------------------------------------------------------------------------- 1 | # Default container setup 2 | # Simple single server setup 3 | # Uses Debian Jessie and official images when possible 4 | 5 | 6 | dbvol: 7 | image: debian:jessie 8 | volumes: 9 | - ./volumes/mysql:/var/lib/mysql 10 | 11 | ezpublishvol: 12 | image: debian:jessie 13 | volumes: 14 | - ./volumes/ezpublish:/var/www 15 | 16 | db1: 17 | image: mariadb:latest 18 | volumes_from: 19 | - dbvol 20 | volumes: 21 | - ./resources/database_character_set.sh:/docker-entrypoint-initdb.d/database_character_set.sh 22 | environment: 23 | - MYSQL_ROOT_PASSWORD=mysecretrootpassword 24 | - MYSQL_USER=ezp 25 | - MYSQL_PASSWORD 26 | - MYSQL_DATABASE=ezp 27 | - TERM=dumb 28 | 29 | phpfpm1: 30 | # docker compose does not allow to specify container name, this is what it generates, might be fixed in 1.3 31 | image: ezsystems/ezphp 32 | links: 33 | - db1:db 34 | # - solr1:solr 35 | volumes_from: 36 | - ezpublishvol 37 | environment: 38 | - EZ_KICKSTART 39 | - EZ_KICKSTART_FROM_TEMPLATE 40 | - EZ_ENVIRONMENT 41 | - EZ_MAILER_TRANSPORT 42 | - EZ_MAILER_HOST 43 | - EZ_MAILER_USER 44 | - EZ_MAILER_PASSWORD 45 | - SYMFONY_ENV 46 | - MYSQL_PASSWORD 47 | 48 | web1: 49 | image: ezsystems/web 50 | links: 51 | - phpfpm1:php_fpm 52 | volumes_from: 53 | - ezpublishvol 54 | ports: 55 | - "8080:80" 56 | environment: 57 | - EZ_ENVIRONMENT 58 | - VARNISH_ENABLED 59 | - DOCKER0NET 60 | 61 | # 62 | #varnish: 63 | # build: dockerfiles/internal/varnish 64 | # links: 65 | # - phpfpm:php_fpm 66 | # - nginx:nginx 67 | # volumes_from: 68 | # - ezpublishvol 69 | # ports: 70 | # - "8081:80" 71 | # environment: 72 | # - VARNISH_ENABLED 73 | -------------------------------------------------------------------------------- /docker-compose_ezpinstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export COMPOSE_PROJECT_NAME=ezpublishdocker 4 | CONFIGFILE=files/docker-compose.config 5 | YMLFILE="docker-compose_ezpinstall.yml" 6 | CMDPARAMETERS="$@" 7 | 8 | # Check for parameter "-c alternative-config.file.config" 9 | function set_composeconfig 10 | { 11 | local value 12 | value=0 13 | 14 | for i in "$@"; do 15 | if [ $i == "-c" ]; then 16 | value=1 17 | continue 18 | fi 19 | if [ $value == 1 ]; then 20 | value=0 21 | CONFIGFILE=$i 22 | echo Config file overriden. Using $CONFIGFILE instead 23 | continue 24 | fi 25 | CMDPARAMETERS="$CMDPARAMETERS $i" 26 | done 27 | } 28 | 29 | set_composeconfig "$@" 30 | 31 | # Load default settings 32 | source files/docker-compose.config-EXAMPLE 33 | 34 | # Load custom settings 35 | source $CONFIGFILE 36 | 37 | if [ ! -f files/auth.json ]; then 38 | touch files/auth.json 39 | fi 40 | 41 | if [ ! -f files/kickstart_template.ini ]; then 42 | touch files/kickstart_template.ini 43 | fi 44 | 45 | # If {COMPOSE_EXECUTION_PATH} is not set and docker-compose is not in path, we'll test if it is located in /opt/bin. Needed for systemd service 46 | if [ "$COMPOSE_EXECUTION_PATH" == "" ]; then 47 | if [ ! `which ${COMPOSE_EXECUTION_PATH}docker-compose > /dev/null` ]; then 48 | if [ -x "/opt/bin/docker-compose" ]; then 49 | COMPOSE_EXECUTION_PATH="/opt/bin/" 50 | fi 51 | fi 52 | fi 53 | 54 | if [ "$SYMFONY_ENV" = "dev" ]; then 55 | YMLFILE="docker-compose_ezpinstall_dev.yml" 56 | fi 57 | 58 | ${COMPOSE_EXECUTION_PATH}docker-compose -f $YMLFILE $CMDPARAMETERS up --no-recreate 59 | 60 | # Unless user has provided install to use in volume folder, install from composer 61 | if [ ! -f volumes/ezpublish/composer.json ]; then 62 | echo "No prior install detected in ezpublish folder, so running Composer with: composer --no-interaction create-project ${EZ_COMPOSERPARAM?}" 63 | ${COMPOSE_EXECUTION_PATH}docker-compose -f $YMLFILE $CMDPARAMETERS run --rm ezphp composer --no-interaction create-project --no-progress ${EZ_COMPOSERPARAM?}; 64 | ${COMPOSE_EXECUTION_PATH}docker-compose -f $YMLFILE $CMDPARAMETERS run --rm ezphp composer dump-autoload --optimize; 65 | ${COMPOSE_EXECUTION_PATH}docker-compose -f $YMLFILE $CMDPARAMETERS run --rm ezphp bash -c "if [ -f /var/www/bin/vhost.sh ]; then chmod a+x /var/www/bin/vhost.sh; fi" 66 | ${COMPOSE_EXECUTION_PATH}docker-compose -f $YMLFILE $CMDPARAMETERS rm -v -f composercachevol ezphp 67 | else 68 | echo "Prior install detected in ezpublish folder, skipp running Composer" 69 | fi 70 | -------------------------------------------------------------------------------- /docker-compose_ezpinstall.yml: -------------------------------------------------------------------------------- 1 | ezpublishvol: 2 | image: debian:jessie 3 | volumes: 4 | - ./volumes/ezpublish:/var/www 5 | # Remove .keep file so composer is able to install in the directory afterwards. UID=10000 and GUID=10000 is ez user in ezphp image 6 | command: bash -c "rm /var/www/.keep; chown 10000:10000 /var/www" 7 | 8 | composercachevol: 9 | image: debian:jessie 10 | volumes: 11 | - ./volumes/composercache:/var/.composer/cache 12 | command: chown 10000:10000 /var/.composer/cache 13 | 14 | ezphp: 15 | image: ezsystems/ezphp 16 | user: ez 17 | volumes_from: 18 | - ezpublishvol 19 | - composercachevol 20 | volumes: 21 | - ./files/auth.json:/var/.composer/auth.json 22 | - ./files/kickstart_template.ini:/kickstart_template.ini 23 | # Override command, we don't want to start php-fpm just yet, just want to run composer command 24 | # That is done in docker-compose_ezpinstall.sh since it needs env variables (todo: fix when on Compose 1.4) 25 | command: php -v 26 | -------------------------------------------------------------------------------- /docker-compose_ezpinstall_dev.yml: -------------------------------------------------------------------------------- 1 | ezpublishvol: 2 | image: debian:jessie 3 | volumes: 4 | - ./volumes/ezpublish:/var/www 5 | # Remove .keep file so composer is able to install in the directory afterwards 6 | command: rm /var/www/.keep 7 | 8 | composercachevol: 9 | image: debian:jessie 10 | volumes: 11 | - ./volumes/composercache:/var/.composer/cache 12 | 13 | ezpphp: 14 | build: dockerfiles/ezphp 15 | dockerfile: Dockerfile-dev 16 | volumes_from: 17 | - ezpublishvol 18 | - composercachevol 19 | volumes: 20 | - ./files/auth.json:/var/.composer/auth.json 21 | # Override command, we don't want to start php-fpm just yet, just want to run composer commands this 22 | command: php -v 23 | -------------------------------------------------------------------------------- /docker-compose_ezpinstall_php5.yml: -------------------------------------------------------------------------------- 1 | 2 | ezphp: 3 | image: ezsystems/ezphp:5.6 4 | -------------------------------------------------------------------------------- /docker-compose_php5.yml: -------------------------------------------------------------------------------- 1 | 2 | phpfpm1: 3 | image: ezsystems/ezphp:5.6 4 | -------------------------------------------------------------------------------- /docker-compose_services-ezp54.yml: -------------------------------------------------------------------------------- 1 | # Example of using the distribution containers 2 | 3 | 4 | site1dbvol: 5 | image: busybox 6 | # volumes: 7 | # - volumes/mysql:/var/lib/mysql 8 | 9 | site1databasedump: 10 | image: ezpublishdocker_databasedump 11 | 12 | site1vardir: 13 | image: ezpublishdocker_vardir 14 | 15 | site1ezpublishvol: 16 | image: ezpublishdocker_distribution 17 | volumes_from: 18 | - site1vardir 19 | 20 | site1db1: 21 | image: mariadb:latest 22 | volumes_from: 23 | - site1dbvol 24 | environment: 25 | - MYSQL_ROOT_PASSWORD=mysecretrootpassword 26 | - MYSQL_USER=ezp 27 | - MYSQL_PASSWORD 28 | - MYSQL_DATABASE=ezp 29 | restart: always 30 | 31 | site1phpfpm1: 32 | # docker compose does not allow to specify container name, this is what it generates, might be fixed in 1.3 33 | image: ezsystems/ezphp 34 | links: 35 | - site1db1:db 36 | volumes_from: 37 | - site1ezpublishvol 38 | environment: 39 | - EZ_KICKSTART 40 | - EZ_KICKSTART_FROM_TEMPLATE 41 | - EZ_ENVIRONMENT 42 | - EZ_MAILER_TRANSPORT 43 | - EZ_MAILER_HOST 44 | - EZ_MAILER_USER 45 | - EZ_MAILER_PASSWORD 46 | - SYMFONY_ENV 47 | - MYSQL_PASSWORD 48 | restart: always 49 | 50 | site1web1: 51 | image: ezsystems/web 52 | links: 53 | - site1phpfpm1:php_fpm 54 | volumes_from: 55 | - site1ezpublishvol 56 | ports: 57 | - "8081:80" 58 | environment: 59 | - EZ_ENVIRONMENT 60 | - SYMFONY_ENV 61 | - VARNISH_ENABLED 62 | - DOCKER0NET 63 | # command: /bin/bash -c "while [ 1 ]; do echo -n .; sleep 10; done" 64 | restart: always 65 | 66 | site1initialize: 67 | image: ezsystems/ezphp 68 | links: 69 | - site1db1:db 70 | volumes_from: 71 | - site1ezpublishvol 72 | - site1databasedump 73 | environment: 74 | - EZ_KICKSTART 75 | - EZ_KICKSTART_FROM_TEMPLATE 76 | - EZ_ENVIRONMENT 77 | - SYMFONY_ENV 78 | - MYSQL_USER=ezp 79 | - MYSQL_PASSWORD 80 | - MYSQL_DATABASE=ezp 81 | command: /prepare_distribution_volume.sh 82 | 83 | -------------------------------------------------------------------------------- /docker-compose_services.yml: -------------------------------------------------------------------------------- 1 | # Example of using the distribution containers 2 | 3 | 4 | site1dbvol: 5 | image: busybox 6 | # volumes: 7 | # - volumes/mysql:/var/lib/mysql 8 | 9 | site1databasedump: 10 | image: ezpublishdocker_databasedump 11 | 12 | site1vardir: 13 | image: ezpublishdocker_vardir 14 | 15 | site1ezpublishvol: 16 | image: ezpublishdocker_distribution 17 | volumes_from: 18 | - site1vardir 19 | 20 | site1db1: 21 | image: mariadb:latest 22 | volumes_from: 23 | - site1dbvol 24 | environment: 25 | - MYSQL_ROOT_PASSWORD=mysecretrootpassword 26 | - MYSQL_USER=ezp 27 | - MYSQL_PASSWORD 28 | - MYSQL_DATABASE=ezp 29 | restart: always 30 | 31 | site1phpfpm1: 32 | # docker compose does not allow to specify container name, this is what it generates, might be fixed in 1.3 33 | image: ezsystems/ezphp 34 | links: 35 | - site1db1:db 36 | volumes_from: 37 | - site1ezpublishvol 38 | environment: 39 | - EZ_KICKSTART 40 | - EZ_KICKSTART_FROM_TEMPLATE 41 | - EZ_MAILER_TRANSPORT 42 | - EZ_MAILER_HOST 43 | - EZ_MAILER_USER 44 | - EZ_MAILER_PASSWORD 45 | - SYMFONY_ENV 46 | - MYSQL_PASSWORD 47 | restart: always 48 | 49 | site1web1: 50 | image: nginx 51 | links: 52 | - site1phpfpm1:php_fpm 53 | volumes_from: 54 | - site1ezpublishvol 55 | ports: 56 | - "8081:80" 57 | environment: 58 | - SYMFONY_ENV 59 | - BASEDIR=/var/www 60 | - MAX_BODY_SIZE=20 61 | - FASTCGI_PASS=php_fpm:9000 62 | - TIMEOUT=190 63 | - DOCKER0NET 64 | command: /bin/bash -c "cd /var/www && cp -a doc/nginx/ez_params.d /etc/nginx && bin/vhost.sh --template-file=doc/nginx/vhost.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'" 65 | restart: always 66 | 67 | site1initialize: 68 | image: ezsystems/ezphp 69 | links: 70 | - site1db1:db 71 | volumes_from: 72 | - site1ezpublishvol 73 | - site1databasedump 74 | environment: 75 | - EZ_KICKSTART 76 | - EZ_KICKSTART_FROM_TEMPLATE 77 | - SYMFONY_ENV 78 | - MYSQL_USER=ezp 79 | - MYSQL_PASSWORD 80 | - MYSQL_DATABASE=ezp 81 | command: /prepare_distribution_volume.sh 82 | 83 | -------------------------------------------------------------------------------- /docker-compose_services_php5.yml: -------------------------------------------------------------------------------- 1 | 2 | site1phpfpm1: 3 | image: ezsystems/ezphp:5.6 4 | -------------------------------------------------------------------------------- /docker-compose_solr.yml.template: -------------------------------------------------------------------------------- 1 | 2 | solr1: 3 | image: makuk66/docker-solr:4.10.4 4 | volumes_from: 5 | - ezpublishvol 6 | command: /bin/bash -c "cp -R /var/www/vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/* /opt/solr/example/solr/collection1/conf/ 7 | && /opt/solr/bin/solr start -f" 8 | 9 | -------------------------------------------------------------------------------- /docker-compose_vagrant-aws.yml: -------------------------------------------------------------------------------- 1 | # dummy container for base image 2 | ubuntu: 3 | build: dockerfiles/ubuntu 4 | vagrantaws: 5 | build: dockerfiles/internal/vagrant-aws -------------------------------------------------------------------------------- /docker-compose_vardir.yml: -------------------------------------------------------------------------------- 1 | vardir: 2 | build: dockerfiles/vardir 3 | -------------------------------------------------------------------------------- /docker_commands.txt: -------------------------------------------------------------------------------- 1 | Remove all containers for a particular image: 2 | docker ps -a | grep 'nginx:latest' | awk '{print $1}' | xargs docker rm 3 | 4 | 5 | Remove all stoped containers 6 | docker ps -a | grep 'Exited' | awk '{print $1}' | xargs docker rm 7 | 8 | 9 | Attach to a running container 10 | docker inspect --format "{{ .State.Pid }}" [container_id] 11 | nsenter --target [pid] --mount --uts --ipc --net --pid 12 | 13 | Attach to a given container ( one liner ) 14 | name="web-1"; container=`docker ps -a | grep "$name " | awk '{print $1}'`; pid=`docker inspect --format "{{ .State.Pid }}" $container`; nsenter --target $pid --mount --uts --ipc --net --pid 15 | 16 | 17 | github, check rate limit: 18 | curl -i https://api.github.com/rate_limit?access_token=... 19 | 20 | 21 | systemctl status -l etcd 22 | journalctl -b -u etcd 23 | 24 | -------------------------------------------------------------------------------- /dockerfiles/databasedump/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM busybox 2 | 3 | copy ezp.sql /dbdump/ezp.sql 4 | 5 | VOLUME ["/dbdump"] 6 | 7 | 8 | CMD ["/bin/true"] 9 | -------------------------------------------------------------------------------- /dockerfiles/distribution/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM busybox 2 | 3 | add ezpublish.tar.gz /var/www 4 | # Make sure /var/www is also owned by ez user 5 | RUN chown 10000:10000 /var/www 6 | 7 | VOLUME [ "/var/www" ] 8 | 9 | CMD ["/bin/true"] 10 | 11 | -------------------------------------------------------------------------------- /dockerfiles/ezphp/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:jessie 2 | 3 | # Container containing php-fpm and php-cli to run and interact with eZ Platform 4 | # 5 | # It has two modes of operation: 6 | # - (default run.sh cmd) 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 install 8 | 9 | # Set defaults for variables used by run.sh 10 | # If you change MAX_EXECUTION TIME, also change fastcgi_read_timeout accordingly in nginx! 11 | ENV DEBIAN_FRONTEND=noninteractive \ 12 | TIMEZONE=Europe/Warsaw \ 13 | MEMORY_LIMIT=256M \ 14 | MAX_EXECUTION_TIME=90 \ 15 | PORT=9000 \ 16 | COMPOSER_HOME=/var/.composer 17 | 18 | ## Get packages 19 | ### unzip needed due to https://github.com/composer/composer/issues/4471 20 | RUN apt-get update -q -y \ 21 | && apt-get install -q -y --force-yes --no-install-recommends \ 22 | php5-cli \ 23 | php5-readline \ 24 | php5-fpm \ 25 | php5-mysqlnd \ 26 | php5-json \ 27 | php5-xsl \ 28 | php5-intl \ 29 | php5-mcrypt \ 30 | php5-gd \ 31 | php5-curl \ 32 | php5-twig \ 33 | mysql-client \ 34 | imagemagick \ 35 | curl \ 36 | wget \ 37 | ca-certificates \ 38 | less \ 39 | vim \ 40 | git \ 41 | acl \ 42 | sudo \ 43 | tree \ 44 | unzip \ 45 | && rm -rf /var/lib/apt/lists/* 46 | 47 | # Create Composer directory (cache and auth files) 48 | RUN mkdir -p $COMPOSER_HOME 49 | 50 | # Set timezone 51 | RUN echo $TIMEZONE > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata 52 | RUN sed -i "s@^;date.timezone =.*@date.timezone = $TIMEZONE@" /etc/php5/*/php.ini 53 | 54 | # Set memory limit 55 | RUN sed -i "s@^memory_limit =.*@memory_limit = $MEMORY_LIMIT@" /etc/php5/fpm/php.ini 56 | 57 | # Increase realpath_cache_size 58 | RUN sed -i "s@^;realpath_cache_size =.*@realpath_cache_size = 256k@" /etc/php5/fpm/php.ini 59 | 60 | # Set Max execution time 61 | RUN sed -i "s@^max_execution_time = .*@max_execution_time = $MAX_EXECUTION_TIME@" /etc/php5/fpm/php.ini 62 | 63 | # Disable daemonizeing php-fpm 64 | RUN sed -i "s@^;daemonize = yes*@daemonize = no@" /etc/php5/fpm/php-fpm.conf 65 | 66 | # Set listen socket for php-fpm 67 | RUN sed -i "s@^listen = /var/run/php5-fpm.sock@listen = $PORT@" /etc/php5/fpm/pool.d/www.conf 68 | 69 | # Get Composer 70 | RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin && mv /usr/local/bin/composer.phar /usr/local/bin/composer 71 | 72 | # As application is put in as volume we do all needed operation on run 73 | ADD run.sh /run.sh 74 | ADD generate_kickstart_file.sh /generate_kickstart_file.sh 75 | ADD generate_parameters_file.sh /generate_parameters_file.sh 76 | ADD prepare_distribution_volume.sh /prepare_distribution_volume.sh 77 | ADD prepare_behat.sh /prepare_behat.sh 78 | ADD config/opcache.ini /etc/php5/mods-available/opcache.ini 79 | 80 | RUN chmod 755 /*.sh 81 | RUN groupadd -g 10000 ez && useradd -g ez -u 10000 ez 82 | 83 | WORKDIR /var/www 84 | 85 | CMD /run.sh 86 | 87 | EXPOSE 9000 88 | -------------------------------------------------------------------------------- /dockerfiles/ezphp/Dockerfile-dev: -------------------------------------------------------------------------------- 1 | FROM debian:jessie 2 | 3 | # Container containing php-fpm and php-cli to run and interact with eZ Platform 4 | # 5 | # It has two modes of operation: 6 | # - (default run.sh cmd) 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 install 8 | 9 | # Set defaults for variables used by run.sh 10 | # If you change MAX_EXECUTION TIME, also change fastcgi_read_timeout accordingly in nginx! 11 | ENV DEBIAN_FRONTEND=noninteractive \ 12 | TIMEZONE=Europe/Warsaw \ 13 | MEMORY_LIMIT=512M \ 14 | MAX_EXECUTION_TIME=180 \ 15 | PORT=9000 \ 16 | COMPOSER_HOME=/var/.composer 17 | 18 | ## Get packages 19 | ### unzip needed due to https://github.com/composer/composer/issues/4471 20 | RUN apt-get update -q -y \ 21 | && apt-get install -q -y --force-yes --no-install-recommends \ 22 | php5-cli \ 23 | php5-readline \ 24 | php5-fpm \ 25 | php5-mysqlnd \ 26 | php5-json \ 27 | php5-xsl \ 28 | php5-intl \ 29 | php5-mcrypt \ 30 | php5-gd \ 31 | php5-curl \ 32 | php5-twig \ 33 | php5-xdebug \ 34 | mysql-client \ 35 | imagemagick \ 36 | curl \ 37 | wget \ 38 | ca-certificates \ 39 | less \ 40 | vim \ 41 | git \ 42 | acl \ 43 | sudo \ 44 | tree \ 45 | unzip \ 46 | && rm -rf /var/lib/apt/lists/* 47 | 48 | # Create Composer directory (cache and auth files) 49 | RUN mkdir -p $COMPOSER_HOME 50 | 51 | # Set timezone 52 | RUN echo $TIMEZONE > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata 53 | RUN sed -i "s@^;date.timezone =.*@date.timezone = $TIMEZONE@" /etc/php5/*/php.ini 54 | 55 | # Set memory limit 56 | RUN sed -i "s@^memory_limit =.*@memory_limit = $MEMORY_LIMIT@" /etc/php5/fpm/php.ini 57 | 58 | # Increase realpath_cache_size 59 | RUN sed -i "s@^;realpath_cache_size =.*@realpath_cache_size = 256k@" /etc/php5/fpm/php.ini 60 | 61 | # Set Max execution time 62 | RUN sed -i "s@^max_execution_time = .*@max_execution_time = $MAX_EXECUTION_TIME@" /etc/php5/fpm/php.ini 63 | 64 | # Enable all error reporting 65 | RUN sed -i "s@^error_reporting = .*@error_reporting = E_ALL@" /etc/php5/*/php.ini 66 | 67 | # Set FPM Debug level 68 | RUN sed -i "s@^;log_level = notice@log_level = debug@" /etc/php5/fpm/php-fpm.conf 69 | 70 | # Disable daemonizeing php-fpm 71 | RUN sed -i "s@^;daemonize = yes*@daemonize = no@" /etc/php5/fpm/php-fpm.conf 72 | 73 | # Set listen socket for php-fpm 74 | RUN sed -i "s@^listen = /var/run/php5-fpm.sock@listen = $PORT@" /etc/php5/fpm/pool.d/www.conf 75 | 76 | # Get Composer 77 | RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin && mv /usr/local/bin/composer.phar /usr/local/bin/composer 78 | 79 | # As application is put in as volume we do all needed operation on run 80 | ADD run.sh /run.sh 81 | ADD generate_kickstart_file.sh /generate_kickstart_file.sh 82 | ADD generate_parameters_file.sh /generate_parameters_file.sh 83 | ADD prepare_distribution_volume.sh /prepare_distribution_volume.sh 84 | ADD prepare_behat.sh /prepare_behat.sh 85 | ADD config/opcache.ini /etc/php5/mods-available/opcache.ini 86 | ADD config/xdebug.ini /etc/php5/mods-available/xdebug.ini 87 | ADD config/xdebug.ini /etc/php5/mods-available/xdebug.ini-ezp54 88 | 89 | RUN chmod 755 /*.sh 90 | RUN groupadd -g 10000 ez && useradd -g ez -u 10000 ez 91 | 92 | WORKDIR /var/www 93 | 94 | CMD /run.sh 95 | 96 | EXPOSE 9000 9001 97 | -------------------------------------------------------------------------------- /dockerfiles/ezphp/Dockerfile-php7: -------------------------------------------------------------------------------- 1 | FROM php:7.1-fpm 2 | 3 | # Container containing php-fpm and php-cli to run and interact with eZ Platform 4 | # 5 | # It has two modes of operation: 6 | # - (default run.sh cmd) 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 install 8 | 9 | # Set defaults for variables used by run.sh 10 | # If you change MAX_EXECUTION TIME, also change fastcgi_read_timeout accordingly in nginx! 11 | ENV DEBIAN_FRONTEND=noninteractive \ 12 | TIMEZONE=Europe/Warsaw \ 13 | MEMORY_LIMIT=256M \ 14 | MAX_EXECUTION_TIME=90 \ 15 | PORT=9000 \ 16 | COMPOSER_HOME=/var/.composer 17 | 18 | ## Get packages 19 | ### unzip needed due to https://github.com/composer/composer/issues/4471 20 | RUN apt-get update -q -y \ 21 | && apt-get install -q -y --force-yes --no-install-recommends \ 22 | libfreetype6-dev \ 23 | libjpeg62-turbo-dev \ 24 | libxpm-dev \ 25 | libpng12-dev \ 26 | libicu-dev \ 27 | libxslt1-dev \ 28 | mysql-client \ 29 | curl \ 30 | wget \ 31 | ca-certificates \ 32 | less \ 33 | vim \ 34 | git \ 35 | acl \ 36 | sudo \ 37 | tree \ 38 | unzip \ 39 | && rm -rf /var/lib/apt/lists/* 40 | 41 | # Install and configure php plugins 42 | RUN docker-php-ext-configure mysqli --with-mysqli=mysqlnd \ 43 | && docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \ 44 | && 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-native-ttf --enable-gd-jis-conv \ 45 | && docker-php-ext-install exif gd mbstring intl xsl zip mysqli pdo_mysql \ 46 | && docker-php-ext-enable opcache 47 | 48 | # Create Composer directory (cache and auth files) 49 | RUN mkdir -p $COMPOSER_HOME 50 | 51 | # Set timezone 52 | RUN echo $TIMEZONE > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata 53 | 54 | # Set some php.ini config 55 | RUN echo "date.timezone = $TIMEZONE" >> /usr/local/etc/php/php.ini \ 56 | && echo "memory_limit = $MEMORY_LIMIT" >> /usr/local/etc/php/php.ini \ 57 | && echo "realpath_cache_size = 256k" >> /usr/local/etc/php/php.ini \ 58 | && echo "display_errors = Off" >> /usr/local/etc/php/php.ini \ 59 | && echo "max_execution_time = $MAX_EXECUTION_TIME" >> /usr/local/etc/php/php.ini 60 | 61 | # Disable daemonizeing php-fpm 62 | #RUN sed -i "s@^;daemonize = yes*@daemonize = no@" /usr/local/etc/php-fpm.conf 63 | 64 | # Add pid file to be able to restart php-fpm 65 | RUN sed -i "s@^\[global\]@\[global\]\n\npid = /run/php-fpm.pid@" /usr/local/etc/php-fpm.conf 66 | 67 | # Set listen socket for php-fpm 68 | RUN sed -i "s@^listen = 127.0.0.1:9000@listen = $PORT@" /usr/local/etc/php-fpm.d/www.conf.default \ 69 | && sed -i "s@^user = nobody@user = www-data@" /usr/local/etc/php-fpm.d/www.conf.default \ 70 | && sed -i "s@^group = nobody@group = www-data@" /usr/local/etc/php-fpm.d/www.conf.default 71 | 72 | # Get Composer 73 | RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin && mv /usr/local/bin/composer.phar /usr/local/bin/composer 74 | 75 | # As application is put in as volume we do all needed operation on run 76 | ADD run.sh /run.sh 77 | ADD generate_kickstart_file.sh /generate_kickstart_file.sh 78 | ADD generate_parameters_file.sh /generate_parameters_file.sh 79 | ADD prepare_distribution_volume.sh /prepare_distribution_volume.sh 80 | ADD prepare_behat.sh /prepare_behat.sh 81 | 82 | #/usr/local/etc/php/conf.d/docker-php-ext-opcache.ini 83 | #ADD config/opcache.ini /usr/local/php7/etc/conf.d/opcache.ini 84 | 85 | RUN chmod 755 /*.sh 86 | RUN groupadd -g 10000 ez && useradd -g ez -u 10000 ez 87 | 88 | WORKDIR /var/www 89 | 90 | CMD /run.sh 91 | 92 | EXPOSE 9000 93 | -------------------------------------------------------------------------------- /dockerfiles/ezphp/config/opcache.ini: -------------------------------------------------------------------------------- 1 | ; configuration for php ZendOpcache module 2 | ; priority=05 3 | zend_extension=opcache.so 4 | 5 | ; Some tweaks to improve performance 6 | ; Tweak to your own needs, further reading: 7 | ; https://secure.php.net/manual/en/opcache.installation.php 8 | ; https://tideways.io/profiler/blog/fine-tune-your-opcache-configuration-to-avoid-caching-suprises 9 | opcache.memory_consumption=128 10 | opcache.interned_strings_buffer=8 11 | opcache.max_accelerated_files=10000 12 | opcache.revalidate_freq=60 13 | opcache.enable_cli=1 14 | opcache.max_wasted_percentage=10 15 | ;opcache.fast_shutdown=1 16 | ; Comment out (enable) in eZ Publish 5.x installs which swaps cwd between symfony & legacy context 17 | opcache.use_cwd=0 18 | 19 | ; Should only be used for real prod (e.g. when code is mounted to a container read only) 20 | ; Implies no cache systems caching to php files and changing the file over the container lifecycle 21 | ;opcache.validate_timestamps=0 22 | ;opcache.enable_file_override=0 23 | -------------------------------------------------------------------------------- /dockerfiles/ezphp/config/xdebug.ini: -------------------------------------------------------------------------------- 1 | ; configuration for php ZendOpcache module 2 | ; priority=20 3 | zend_extension=xdebug.so 4 | 5 | ; xdebug config 6 | xdebug.max_nesting_level = 200 7 | 8 | xdebug.remote_enable=1 9 | xdebug.remote_host=localhost 10 | xdebug.remote_port=9001 11 | 12 | xdebug.profiler_enable = 1 13 | xdebug.profiler_output_name = xdebug.out.%t 14 | xdebug.profiler_output_dir = /var/www/app/log 15 | xdebug.profiler_enable_trigger = 1 16 | -------------------------------------------------------------------------------- /dockerfiles/ezphp/config/xdebug.ini-ezp54: -------------------------------------------------------------------------------- 1 | ; configuration for php ZendOpcache module 2 | ; priority=20 3 | zend_extension=xdebug.so 4 | 5 | ; xdebug config 6 | xdebug.max_nesting_level = 200 7 | 8 | xdebug.remote_enable=1 9 | xdebug.remote_host=localhost 10 | xdebug.remote_port=9001 11 | 12 | xdebug.profiler_enable = 1 13 | xdebug.profiler_output_name = xdebug.out.%t 14 | xdebug.profiler_output_dir = /var/www/ezpublish/log 15 | xdebug.profiler_enable_trigger = 1 16 | -------------------------------------------------------------------------------- /dockerfiles/ezphp/generate_kickstart_file.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Parameter $1 is value of EZ_KICKSTART_FROM_TEMPLATE ( could be empty ) 4 | 5 | if [ ! -f ezpublish_legacy/kickstart.ini-dist ]; then 6 | if [ -d app ]; then 7 | echo "WARNING: EZ_KICKSTART is set to true, but ezpublish_legacy folder does not exists" 8 | exit 0 9 | fi 10 | echo "ERROR: Could not find ezpublish_legacy/kickstart.ini-dist, did you forget to place eZ Publish in vagrant/ezpublish folder?" 11 | exit 1; 12 | fi 13 | 14 | if [ "aa$1" == "aa" ]; then 15 | echo "Generating kickstart.ini" 16 | 17 | echo "[database_choice] 18 | Continue=true 19 | Type=mysqli 20 | 21 | [database_init] 22 | #Continue=true 23 | Server=db 24 | Port=${DB_PORT_3306_TCP_PORT} 25 | Database=ezp 26 | User=ezp 27 | Password=${MYSQL_PASSWORD} 28 | Socket= 29 | 30 | [site_details] 31 | Database=ezp 32 | " > ezpublish_legacy/kickstart.ini 33 | else 34 | echo "Creating kickstart.ini from template" 35 | cp $1 ezpublish_legacy/kickstart.ini 36 | 37 | sed -i "s@^Server=@Server=db@" ezpublish_legacy/kickstart.ini 38 | sed -i "s@^Database=@Database=ezp@" ezpublish_legacy/kickstart.ini 39 | sed -i "s@^User=@User=ezp@" ezpublish_legacy/kickstart.ini 40 | sed -i "s@^Password=\$@Password=${MYSQL_PASSWORD}@" ezpublish_legacy/kickstart.ini 41 | fi 42 | -------------------------------------------------------------------------------- /dockerfiles/ezphp/generate_parameters_file.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Reconfigured parameters.yml on every startup on docker as config might change while volume stays the same 3 | 4 | echo "Re-configuring parameters.yml" 5 | 6 | function generate_secret 7 | { 8 | local secret 9 | secret=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32|head -n 1) 10 | echo $secret 11 | } 12 | 13 | SECRET=`generate_secret` 14 | 15 | APP_FOLDER="app" 16 | if [ -d ezpublish ]; then 17 | APP_FOLDER="ezpublish" 18 | fi 19 | 20 | if [ "$MYSQL_HOST" == "" ]; then 21 | MYSQL_HOST="db" 22 | fi 23 | 24 | if [ "$MYSQL_PORT" == "" ]; then 25 | if [ "$DB_PORT_3306_TCP_PORT" == "" ]; then 26 | DB_PORT_3306_TCP_PORT=3306 27 | fi 28 | MYSQL_PORT="$DB_PORT_3306_TCP_PORT" 29 | fi 30 | 31 | if [ "$MYSQL_DATABASE" == "" ]; then 32 | MYSQL_DATABASE="ezp" 33 | fi 34 | 35 | if [ "$MYSQL_USER" == "" ]; then 36 | MYSQL_USER="ezp" 37 | fi 38 | 39 | if [ "$MYSQL_PASSWORD" == "" ]; then 40 | MYSQL_PASSWORD="ezp" 41 | fi 42 | 43 | sed -i "s@secret:.*@secret: $SECRET@" $APP_FOLDER/config/parameters.yml 44 | sed -i "s@database_driver:.*@database_driver: pdo_mysql@" $APP_FOLDER/config/parameters.yml 45 | sed -i "s@database_port:.*@database_port: $MYSQL_PORT@" $APP_FOLDER/config/parameters.yml 46 | sed -i "s@database_host:.*@database_host: $MYSQL_HOST@" $APP_FOLDER/config/parameters.yml 47 | sed -i "s@database_name:.*@database_name: $MYSQL_DATABASE@" $APP_FOLDER/config/parameters.yml 48 | sed -i "s@database_user:.*@database_user: $MYSQL_USER@" $APP_FOLDER/config/parameters.yml 49 | sed -i "s@database_password:.*@database_password: $MYSQL_PASSWORD@" $APP_FOLDER/config/parameters.yml 50 | 51 | 52 | 53 | 54 | 55 | if [ "$EZ_MAILER_TRANSPORT" != "" ]; then 56 | sed -i "s@mailer_transport:.*@mailer_transport: $EZ_MAILER_TRANSPORT@" $APP_FOLDER/config/parameters.yml 57 | fi 58 | 59 | if [ "$EZ_MAILER_HOST" != "" ]; then 60 | sed -i "s@mailer_host:.*@mailer_host: $EZ_MAILER_HOST@" $APP_FOLDER/config/parameters.yml 61 | fi 62 | 63 | if [ "$EZ_MAILER_USER" != "" ]; then 64 | sed -i "s@mailer_user:.*@mailer_user: $EZ_MAILER_USER@" $APP_FOLDER/config/parameters.yml 65 | fi 66 | 67 | if [ "$EZ_MAILER_PASSWORD" != "" ]; then 68 | sed -i "s@mailer_password:.*@mailer_password: $EZ_MAILER_PASSWORD@" $APP_FOLDER/config/parameters.yml 69 | fi 70 | 71 | 72 | if [ "$SOLR_PORT_8983_TCP_ADDR" != "" ]; then 73 | sed -i "s@search_engine:.*@search_engine: solr@" $APP_FOLDER/config/parameters.yml 74 | sed -i "s@solr_dsn:.*@solr_dsn: http://$SOLR_PORT_8983_TCP_ADDR:8983/solr@" $APP_FOLDER/config/parameters.yml 75 | else 76 | sed -i "s@search_engine:.*@search_engine: legacy@" $APP_FOLDER/config/parameters.yml 77 | fi 78 | 79 | cat $APP_FOLDER/config/parameters.yml 80 | -------------------------------------------------------------------------------- /dockerfiles/ezphp/prepare_behat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copy and prepare behat config if selenium is present 4 | if [ "$SELENIUM_PORT_4444_TCP_ADDR" != "" ]; then 5 | cp -f behat.yml.dist behat.yml 6 | sed -i "s@wd_host: 'http://localhost:4444/@wd_host: 'http://selenium:4444/@" behat.yml 7 | sed -i "s@http://localhost@http://web@" behat.yml 8 | fi 9 | 10 | 11 | -------------------------------------------------------------------------------- /dockerfiles/ezphp/prepare_distribution_volume.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Let's try to connect to db for 2 minutes ( 24 * 5 sec intervalls ) 4 | MAXTRY=24 5 | 6 | cd /var/www 7 | 8 | 9 | function prevent_multiple_execuition 10 | { 11 | if [ -f /tmp/prepare_distribution_already_run.txt ]; then 12 | echo "Script has already been executed. Bailling out" 13 | exit 14 | fi 15 | sudo -u ez touch /tmp/prepare_distribution_already_run.txt 16 | } 17 | 18 | function getIndexScript 19 | { 20 | if [ -f /var/www/web/index.php ]; then 21 | INDEX_SCRIPT=/var/www/web/index.php 22 | else 23 | INDEX_SCRIPT=/var/www/web/app.php 24 | fi 25 | } 26 | 27 | # $1 is description 28 | function set_splash_screen 29 | { 30 | if [ ! -f "${INDEX_SCRIPT}.org" ]; then 31 | sudo -u ez mv ${INDEX_SCRIPT} ${INDEX_SCRIPT}.org 32 | fi 33 | sudo -u ez echo "$1" > ${INDEX_SCRIPT} 34 | } 35 | 36 | function remove_splash_screen 37 | { 38 | sudo -u ez mv ${INDEX_SCRIPT}.org ${INDEX_SCRIPT} 39 | } 40 | 41 | function set_permissions 42 | { 43 | if [ "aa$APACHE_RUN_USER" == "aa" ]; then 44 | APACHE_RUN_USER=www-data 45 | fi 46 | 47 | if [ ! -d web/var ]; then 48 | sudo -u ez mkdir web/var 49 | fi 50 | 51 | if [ -d ezpublish ]; then 52 | setfacl -R -m u:$APACHE_RUN_USER:rwX -m u:ez:rwX ezpublish/{cache,logs,sessions} web/var 53 | setfacl -dR -m u:$APACHE_RUN_USER:rwX -m u:ez:rwX ezpublish/{cache,logs,sessions} web/var 54 | else 55 | setfacl -R -m u:$APACHE_RUN_USER:rwX -m u:ez:rwX app/{cache,logs} web/var 56 | setfacl -dR -m u:$APACHE_RUN_USER:rwX -m u:ez:rwX app/{cache,logs} web/var 57 | fi 58 | 59 | if [ -d ezpublish_legacy ]; then 60 | setfacl -R -m u:$APACHE_RUN_USER:rwx -m u:ez:rwx ezpublish_legacy/{design,extension,settings,var} ezpublish/config web 61 | setfacl -dR -m u:$APACHE_RUN_USER:rwx -m u:ez:rwx ezpublish_legacy/{design,extension,settings,var} ezpublish/config web 62 | fi 63 | } 64 | 65 | function import_database 66 | { 67 | local DBUP 68 | local TRY 69 | DBUP=false 70 | TRY=1 71 | while [ $DBUP == "false" ]; do 72 | echo Contacting mysql, attempt :$TRY 73 | set_splash_screen "Waiting for db connection" 74 | echo "ALTER DATABASE $MYSQL_DATABASE CHARACTER SET utf8 COLLATE utf8_general_ci" | mysql -u$MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE -h db && DBUP="true" 75 | if [ $DBUP == "true" ]; then 76 | DBUP=false 77 | echo "Importing database" 78 | set_splash_screen "Importing database" 79 | sudo -u ez mysql -u$MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE -h db< /dbdump/ezp.sql && DBUP="true" 80 | fi 81 | 82 | if [ $DBUP == "false" ]; then 83 | echo "Attempt $TRY failed. Waiting for db connection" 84 | set_splash_screen "Attempt $TRY failed. Waiting for db connection" 85 | else 86 | echo "Database import succeeded" 87 | fi 88 | let TRY=$TRY+1 89 | if [ $TRY -eq $MAXTRY ]; then 90 | echo Max limit reached. Not able to connect to mysql 91 | sudo -u ez rm /tmp/prepare_distribution_already_run.txt 92 | exit 1; 93 | fi 94 | sleep 5; 95 | done 96 | } 97 | 98 | function warm_cache 99 | { 100 | APP_FOLDER="app" 101 | if [ -d ezpublish ]; then 102 | APP_FOLDER="ezpublish" 103 | fi 104 | sudo -u ez php $APP_FOLDER/console cache:warmup --env=$SYMFONY_ENV 105 | } 106 | 107 | prevent_multiple_execuition 108 | set_splash_screen "Initializing" 109 | set_permissions 110 | set_splash_screen "Waiting for db connection" 111 | import_database 112 | 113 | if [ "$WARM_CACHE" != "false" ]; then 114 | set_splash_screen "Warming cache" 115 | warm_cache 116 | fi 117 | 118 | remove_splash_screen 119 | 120 | cd - > /dev/null 121 | 122 | -------------------------------------------------------------------------------- /dockerfiles/ezphp/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Script accepts the following environment variable: 4 | # - EZ_KICKSTART ( "true" or "false" ) 5 | # - EZ_KICKSTART_FROM_TEMPLATE ( template file ) 6 | # Note that the value of this setting passed on to this script is the filename outside the container. Inside the container, the actuall file will always be named /kickstart_template.ini 7 | # Therefore, the value of this setting will be rewritten internally in the script 8 | # 9 | # Parameters can also be given as options, in the same order: 10 | # ./run.sh [ EZ_KICKSTART ] [ EZ_KICKSTART_FROM_TEMPLATE ] 11 | 12 | function parseCommandlineOptions 13 | { 14 | if [ "$1" != "" ]; then 15 | EZ_KICKSTART=$1 16 | fi 17 | if [ "$2" != "" ]; then 18 | EZ_KICKSTART_FROM_TEMPLATE="/kickstart_template.ini" 19 | fi 20 | 21 | if [ "$APACHE_RUN_USER" == "" ]; then 22 | APACHE_RUN_USER=www-data 23 | fi 24 | 25 | # You might set SKIP_INITIALIZING_VAR=true if you would like to setup web/var from outside this container 26 | if [ "$SKIP_INITIALIZING_VAR" == "true" ]; then 27 | VARDIR="" 28 | else 29 | SKIP_INITIALIZING_VAR="false" 30 | VARDIR=" web/var" 31 | fi 32 | } 33 | 34 | function getAppFolder 35 | { 36 | APP_FOLDER="app" 37 | if [ -d ezpublish ]; then 38 | APP_FOLDER="ezpublish" 39 | fi 40 | } 41 | 42 | parseCommandlineOptions $1 $2 43 | getAppFolder 44 | 45 | # If using Dockerfile-dev and we are dealing with ezp 5.4 we'll need to replace xdebug.ini 46 | if [[ "$APP_FOLDER" == "ezpublish" && -f /etc/php5/mods-available/xdebug.ini-ezp54 ]]; then 47 | cp /etc/php5/mods-available/xdebug.ini-ezp54 /etc/php5/mods-available/xdebug.ini 48 | fi 49 | 50 | # Prepare for setup wizard if requested 51 | if [ "$EZ_KICKSTART" = "true" ]; then 52 | /generate_kickstart_file.sh $EZ_KICKSTART_FROM_TEMPLATE 53 | fi 54 | 55 | /generate_parameters_file.sh 56 | 57 | 58 | echo "Setting permissions on eZ Publish folder as they might be broken if rsync is used" 59 | if [ ! -d web/var ] && [ "$SKIP_INITIALIZING_VAR" == "false" ]; then 60 | sudo -u ez mkdir web/var 61 | fi 62 | 63 | if [ -d ezpublish ]; then 64 | setfacl -R -m u:$APACHE_RUN_USER:rwX -m u:ez:rwX ezpublish/{cache,logs,sessions}${VARDIR} 65 | setfacl -dR -m u:$APACHE_RUN_USER:rwX -m u:ez:rwX ezpublish/{cache,logs,sessions}${VARDIR} 66 | else 67 | setfacl -R -m u:$APACHE_RUN_USER:rwX -m u:ez:rwX app/{cache,logs}${VARDIR} 68 | setfacl -dR -m u:$APACHE_RUN_USER:rwX -m u:ez:rwX app/{cache,logs}${VARDIR} 69 | fi 70 | 71 | if [ -d ezpublish_legacy ]; then 72 | setfacl -R -m u:$APACHE_RUN_USER:rwx -m u:ez:rwx ezpublish_legacy/{design,extension,settings,var} ezpublish/config web 73 | setfacl -dR -m u:$APACHE_RUN_USER:rwx -m u:ez:rwx ezpublish_legacy/{design,extension,settings,var} ezpublish/config web 74 | fi 75 | 76 | APP_FOLDER="app" 77 | if [ -d ezpublish ]; then 78 | APP_FOLDER="ezpublish" 79 | fi 80 | 81 | echo "Clear cache after parameters where updated" 82 | sudo -E -u ez php $APP_FOLDER/console cache:clear --env $SYMFONY_ENV 83 | 84 | if [ "$SYMFONY_ENV" != "dev" ]; then 85 | echo "Re-generate symlink assets in case rsync was used so asstets added during setup wizards are reachable" 86 | sudo -u ez php $APP_FOLDER/console assetic:dump --env $SYMFONY_ENV 87 | fi 88 | 89 | sudo -u ez php $APP_FOLDER/console assets:install --symlink --relative --env $SYMFONY_ENV 90 | 91 | if [ -d ezpublish_legacy ]; then 92 | sudo -u ez php $APP_FOLDER/console ezpublish:legacy:assets_install --symlink --relative --env $SYMFONY_ENV 93 | fi 94 | 95 | # Start php-fpm 96 | if [ -x /usr/local/sbin/php-fpm ]; then 97 | exec /usr/local/sbin/php-fpm 98 | else 99 | exec /usr/sbin/php5-fpm 100 | fi 101 | -------------------------------------------------------------------------------- /dockerfiles/internal/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx 2 | 3 | # Set defaults for variables used by run.sh 4 | # If you change FASTCGI_READ_TIMEOUT, also change max_execution_time accordingly in php-fpm! 5 | ENV PORT=80 \ 6 | BASEDIR=/var/www \ 7 | FASTCGI_READ_TIMEOUT=190 8 | 9 | 10 | # Remove default config and make sure nginx starts as process for docker 11 | RUN rm /etc/nginx/conf.d/default.conf && echo "daemon off;" >> /etc/nginx/nginx.conf 12 | 13 | # Most config will be done on startup by run.sh when we have access to config 14 | ADD run.sh /run.sh 15 | CMD ["/run.sh"] 16 | -------------------------------------------------------------------------------- /dockerfiles/internal/nginx/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | 6 | # Copy nginx config from [ezp_base_dir]/doc/nginx 7 | cp ${BASEDIR}/doc/nginx/etc/nginx/sites-available/mysite.com /etc/nginx/conf.d/ez.conf 8 | cp -a ${BASEDIR}/doc/nginx/etc/nginx/ez_params.d /etc/nginx/ 9 | 10 | # Make sure nginx forwards to php5-fpm on tcp port, not unix socket 11 | sed -i "s@ fastcgi_pass unix:/var/run/php5-fpm.sock;@ # fastcgi_pass unix:/var/run/php5-fpm.sock;@" /etc/nginx/conf.d/ez.conf 12 | sed -i "s@ #fastcgi_pass 127.0.0.1:9000;@ fastcgi_pass php_fpm:${PHP_FPM_PORT_9000_TCP_PORT};@" /etc/nginx/conf.d/ez.conf 13 | 14 | if [ -d /var/www/ezpublish ]; then 15 | VAR_ENVIRONMENT="ENVIRONMENT" 16 | VAR_HTTP_CACHE="USE_HTTP_CACHE" 17 | VAR_TRUSTED_PROXIES="TRUSTED_PROXIES" 18 | else 19 | VAR_ENVIRONMENT="SYMFONY_ENV" 20 | VAR_HTTP_CACHE="SYMFONY_HTTP_CACHE" 21 | VAR_TRUSTED_PROXIES="SYMFONY_TRUSTED_PROXIES" 22 | fi 23 | 24 | # Setting environment for ezplatform ( dev/prod/behat etc ) 25 | sed -i "s@ #fastcgi_param $VAR_ENVIRONMENT dev;@ fastcgi_param $VAR_ENVIRONMENT ${EZ_ENVIRONMENT};@" /etc/nginx/conf.d/ez.conf 26 | 27 | # Disable asset rewrite rules if dev env 28 | if [ "$EZ_ENVIRONMENT" == "dev" ]; then 29 | sed -i "s@ include ez_params.d/ez_prod_rewrite_params;@ # include ez_params.d/ez_prod_rewrite_params;@" /etc/nginx/conf.d/ez.conf 30 | fi 31 | 32 | # Update port number and basedir in /etc/nginx/conf.d/ez.conf 33 | sed -i "s@%PORT%@${PORT}@" /etc/nginx/conf.d/ez.conf 34 | sed -i "s@%BASEDIR%@${BASEDIR}@" /etc/nginx/conf.d/ez.conf 35 | 36 | echo "fastcgi_read_timeout $FASTCGI_READ_TIMEOUT;" > /etc/nginx/conf.d/fastcgi_read_timeout.conf 37 | 38 | if [ "$VARNISH_ENABLED" == "yes" ]; then 39 | sed -i "s@ #fastcgi_param $VAR_HTTP_CACHE 1;@ fastcgi_param $VAR_HTTP_CACHE 0;@" /etc/nginx/conf.d/ez.conf 40 | sed -i "s@ #fastcgi_param $VAR_TRUSTED_PROXIES \"%PROXY%\";@ fastcgi_param $VAR_TRUSTED_PROXIES \"${DOCKER0NET}\";@" /etc/nginx/conf.d/ez.conf 41 | fi 42 | 43 | 44 | exec /usr/sbin/nginx 45 | #while [ 1 ]; do echo -n .; sleep 60; done 46 | #exec /bin/bash 47 | -------------------------------------------------------------------------------- /dockerfiles/internal/vagrant-aws/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:trusty 2 | 3 | RUN apt-get update -y 4 | 5 | RUN apt-get install -y --force-yes \ 6 | ruby \ 7 | ruby1.9.1-dev \ 8 | git \ 9 | man \ 10 | mc \ 11 | wget \ 12 | make 13 | 14 | RUN cd /tmp; wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.5_x86_64.deb 15 | RUN dpkg --install /tmp/vagrant_1.6.5_x86_64.deb 16 | RUN gem install bundler 17 | 18 | RUN cd /tmp; git clone https://github.com/mitchellh/vagrant-aws.git 19 | RUN cd /tmp/vagrant-aws && bundle install 20 | RUN cd /tmp/vagrant-aws && rake install 21 | RUN cd /tmp/vagrant-aws && VAGRANT_FORCE_BUNDLER=1 vagrant plugin install pkg/vagrant-aws-0.5.1.gem 22 | RUN vagrant box add dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box 23 | 24 | 25 | CMD /bin/true 26 | 27 | -------------------------------------------------------------------------------- /dockerfiles/internal/vagrant-aws/utopic_notes.txt: -------------------------------------------------------------------------------- 1 | #FROM ezpublishdocker_ubuntu 2 | #FROM ubuntu:trusty 3 | FROM ubuntu:utopic 4 | 5 | RUN apt-get update -y 6 | 7 | RUN apt-get install -y --force-yes \ 8 | ruby \ 9 | git \ 10 | man \ 11 | vagrant \ 12 | make 13 | # ruby1.9.1-dev \ 14 | 15 | 16 | ###RUN ssh-keyscan github.com >> ~/.ssh/known_hosts 17 | on ubuntu:trusty: 18 | cd /tmp; git clone https://github.com/mitchellh/vagrant-aws.git 19 | cd /tmp/vagrant-aws && gem build vagrant-aws.gemspec 20 | cd /tmp/vagrant-aws && vagrant plugin install vagrant-aws --plugin-version 0.5.1 21 | 22 | #rake 23 | on ubuntu:utopic: 24 | ln -s /usr/bin/ruby19.....( not sure it is needed ) 25 | ln -s /usr/bin/gem1.9.1 /usr/bin/gem 26 | ln -s /usr/bin/rake1.9.1 /usr/bin/rake 27 | ln -s /usr/bin/ri1.9.1 /usr/bin/ri 28 | ln -s /usr/bin/irb1.9.1 /usr/bin/irb 29 | 30 | apt-get install gcc libxml2-dev 31 | # cd /tmp; git clone https://github.com/mitchellh/vagrant-aws.git 32 | # cd /tmp/vagrant-aws && gem1.9.1 build vagrant-aws.gemspec 33 | 34 | dpkg --purge libruby2.1:amd64 ruby ruby-childprocess ruby-ffi ruby-erubis ruby-i18n ruby-log4r ruby-net-scp ruby-net-ssh ruby2.1 rubygems-integration vagrant 35 | apt-get install ruby1.9.1 ruby1.9.1-dev vagrant 36 | (also gcc?) 37 | 38 | libruby1.9.1 libruby2.1 ruby ruby-childprocess ruby-erubis ruby-ffi ruby-i18n ruby-log4r ruby-net-scp ruby-net-ssh ruby2.1 rubygems-integration 39 | 40 | for i in /usr/bin/erb /usr/bin/testrb /usr/bin/rake /usr/bin/ruby /usr/bin/rdoc /usr/bin/gem /usr/bin/ri /usr/bin/irb; do rm "$i"; ln -s ${i}1.9.1 $i; done 41 | ( /usr/bin/rake do not exists ) 42 | 43 | 44 | on LTS: 45 | ruby: 46 | The following NEW packages will be installed: 47 | bsdmainutils bsdtar ca-certificates curl git git-man groff-base krb5-locales 48 | libarchive13 libasn1-8-heimdal libcurl3 libcurl3-gnutls libedit2 49 | liberror-perl libgssapi-krb5-2 libgssapi3-heimdal libhcrypto4-heimdal 50 | libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal libidn11 51 | libk5crypto3 libkeyutils1 libkrb5-26-heimdal libkrb5-3 libkrb5support0 52 | libldap-2.4-2 liblzo2-2 libnettle4 libpipeline1 libroken18-heimdal librtmp0 53 | libruby1.9.1 libsasl2-2 libsasl2-modules libsasl2-modules-db 54 | libwind0-heimdal libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 55 | libxml2 libxmuu1 libyaml-0-2 make man-db openssh-client openssl patch rsync 56 | ruby ruby-childprocess ruby-erubis ruby-ffi ruby-i18n ruby-log4r 57 | ruby-net-scp ruby-net-ssh ruby1.9.1 sgml-base vagrant xauth xml-core 58 | 59 | ruby1.9.1-dev: 60 | The following NEW packages will be installed: 61 | binutils cpp cpp-4.8 gcc gcc-4.8 libasan0 libatomic1 libc-dev-bin libc6-dev 62 | libcloog-isl4 libgcc-4.8-dev libgmp10 libgomp1 libisl10 libitm1 libmpc3 63 | libmpfr4 libquadmath0 libtsan0 linux-libc-dev manpages manpages-dev 64 | ruby1.9.1-dev 65 | 66 | Vagrant 1.4.3 67 | gem1.9.1 install bundle 68 | bundle install 69 | 70 | 71 | gem install nokogiri -- --use-system-libraries 72 | 73 | If you are using Bundler, tell it to use the option: 74 | 75 | bundle config build.nokogiri --use-system-libraries 76 | bundle install 77 | 78 | 79 | 80 | 81 | 82 | #gem install bundle 83 | #cd /tmp/vagrant-aws && gem build vagrant-aws.gemspec 84 | 85 | # do not run as root: 86 | #RUN cd /tmp/vagrant-aws && bundle install 87 | #RUN cd /tmp/vagrant-aws && rake install 88 | 89 | #RUN gem install fog 90 | 91 | # gem build vagrant-aws.gemspec 92 | # vagrant plugin install vagrant-aws --plugin-version 0.5.1 93 | 94 | CMD /bin/true 95 | 96 | -------------------------------------------------------------------------------- /dockerfiles/internal/varnish/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM million12/varnish 2 | 3 | RUN yum --assumeyes install \ 4 | supervisor 5 | 6 | ADD run.sh /run.sh 7 | ADD supervisord-base.conf-part /supervisord-base.conf-part 8 | ADD varnish4.vcl /varnish_config_fallback/varnish4.vcl 9 | 10 | # The current stuff is yet not implemented: 11 | # - Setting varnis cache size and other varnish parameters not yet supported ( ref comment in dockerfiles/internal/varnish/supervisord-base.conf-part ) 12 | 13 | CMD /run.sh 14 | -------------------------------------------------------------------------------- /dockerfiles/internal/varnish/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | cat /supervisord-base.conf-part > /etc/supervisord.d/supervisord-varnish.ini 6 | 7 | # copy .vcl from [ezp_base_dir]/doc/varnish/vcl/varnish4.vcl if it exists, if not use fallback config 8 | if [ -f /var/www/doc/varnish/vcl/varnish4.vcl ]; then 9 | sleep 2 10 | cp /var/www/doc/varnish/vcl/varnish4.vcl /etc/varnish/varnish4.vcl 11 | else 12 | cp /varnish_config_fallback/varnish4.vcl /etc/varnish/varnish4.vcl 13 | fi 14 | 15 | sed -i '/\.host = "127.0.0.1";/c .host = "nginx";' /etc/varnish/varnish4.vcl 16 | sed -i '/acl invalidators {/a "php_fpm";' /etc/varnish/varnish4.vcl 17 | 18 | exec supervisord -n 19 | -------------------------------------------------------------------------------- /dockerfiles/internal/varnish/supervisord-base.conf-part: -------------------------------------------------------------------------------- 1 | 2 | [supervisord] 3 | nodaemon=true 4 | 5 | [program:varnish] 6 | #command=/sbin/varnishd -F -u varnish -f /etc/varnish/varnish4.vcl -s malloc,$CACHE_SIZE $VARNISHD_PARAMS -P /var/run/varnishd.pid 7 | command=/sbin/varnishd -F -u varnish -f /etc/varnish/varnish4.vcl -s malloc -P /var/run/varnishd.pid 8 | autostart=true 9 | autorestart=true 10 | 11 | -------------------------------------------------------------------------------- /dockerfiles/internal/varnish/varnish4.vcl: -------------------------------------------------------------------------------- 1 | // Varnish 4 style - eZ 5.4+ / 2014.09+ 2 | // Complete VCL example 3 | 4 | vcl 4.0; 5 | 6 | // Our Backend - Assuming that web server is listening on port 80 7 | // Replace the host to fit your setup 8 | backend ezpublish { 9 | .host = "127.0.0.1"; 10 | .port = "80"; 11 | } 12 | 13 | // ACL for invalidators IP 14 | acl invalidators { 15 | "127.0.0.1"; 16 | "192.168.0.0"/16; 17 | } 18 | 19 | // ACL for debuggers IP 20 | acl debuggers { 21 | "127.0.0.1"; 22 | "192.168.0.0"/16; 23 | } 24 | 25 | // Called at the beginning of a request, after the complete request has been received 26 | sub vcl_recv { 27 | 28 | // Set the backend 29 | set req.backend_hint = ezpublish; 30 | 31 | // Advertise Symfony for ESI support 32 | set req.http.Surrogate-Capability = "abc=ESI/1.0"; 33 | 34 | // Add a unique header containing the client address (only for master request) 35 | // Please note that /_fragment URI can change in Symfony configuration 36 | if (!req.url ~ "^/_fragment") { 37 | if (req.http.x-forwarded-for) { 38 | set req.http.X-Forwarded-For = req.http.X-Forwarded-For + ", " + client.ip; 39 | } else { 40 | set req.http.X-Forwarded-For = client.ip; 41 | } 42 | } 43 | 44 | // Trigger cache purge if needed 45 | call ez_purge; 46 | 47 | // Don't cache requests other than GET and HEAD. 48 | if (req.method != "GET" && req.method != "HEAD") { 49 | return (pass); 50 | } 51 | 52 | // Normalize the Accept-Encoding headers 53 | if (req.http.Accept-Encoding) { 54 | if (req.http.Accept-Encoding ~ "gzip") { 55 | set req.http.Accept-Encoding = "gzip"; 56 | } elsif (req.http.Accept-Encoding ~ "deflate") { 57 | set req.http.Accept-Encoding = "deflate"; 58 | } else { 59 | unset req.http.Accept-Encoding; 60 | } 61 | } 62 | 63 | // Don't cache Authenticate & Authorization 64 | // You may remove this when using REST API with basic auth. 65 | if (req.http.Authenticate || req.http.Authorization) { 66 | if (client.ip ~ debuggers) { 67 | set req.http.X-Debug = "Not Cached according to configuration (Authorization)"; 68 | } 69 | return (hash); 70 | } 71 | 72 | // Do a standard lookup on assets 73 | // Note that file extension list below is not extensive, so consider completing it to fit your needs. 74 | if (req.url ~ "\.(css|js|gif|jpe?g|bmp|png|tiff?|ico|img|tga|wmf|svg|swf|ico|mp3|mp4|m4a|ogg|mov|avi|wmv|zip|gz|pdf|ttf|eot|wof)$") { 75 | return (hash); 76 | } 77 | 78 | // Retrieve client user hash and add it to the forwarded request. 79 | call ez_user_hash; 80 | 81 | // If it passes all these tests, do a lookup anyway. 82 | return (hash); 83 | } 84 | 85 | // Called when the requested object has been retrieved from the backend 86 | sub vcl_backend_response { 87 | 88 | if (bereq.http.accept ~ "application/vnd.fos.user-context-hash" 89 | && beresp.status >= 500 90 | ) { 91 | return (abandon); 92 | } 93 | 94 | // Optimize to only parse the Response contents from Symfony 95 | if (beresp.http.Surrogate-Control ~ "ESI/1.0") { 96 | unset beresp.http.Surrogate-Control; 97 | set beresp.do_esi = true; 98 | } 99 | 100 | // Allow stale content, in case the backend goes down or cache is not fresh any more 101 | // make Varnish keep all objects for 1 hours beyond their TTL 102 | set beresp.grace = 1h; 103 | } 104 | 105 | // Handle purge 106 | // You may add FOSHttpCacheBundle tagging rules 107 | // See http://foshttpcache.readthedocs.org/en/latest/varnish-configuration.html#id4 108 | sub ez_purge { 109 | 110 | if (req.method == "BAN") { 111 | if (!client.ip ~ invalidators) { 112 | return (synth(405, "Method not allowed")); 113 | } 114 | 115 | if (req.http.X-Location-Id) { 116 | ban("obj.http.X-Location-Id ~ " + req.http.X-Location-Id); 117 | if (client.ip ~ debuggers) { 118 | set req.http.X-Debug = "Ban done for content connected to LocationId " + req.http.X-Location-Id; 119 | } 120 | return (synth(200, "Banned")); 121 | } 122 | } 123 | } 124 | 125 | // Sub-routine to get client user hash, for context-aware HTTP cache. 126 | sub ez_user_hash { 127 | 128 | // Prevent tampering attacks on the hash mechanism 129 | if (req.restarts == 0 130 | && (req.http.accept ~ "application/vnd.fos.user-context-hash" 131 | || req.http.x-user-hash 132 | ) 133 | ) { 134 | return (synth(400)); 135 | } 136 | 137 | if (req.restarts == 0 && (req.method == "GET" || req.method == "HEAD")) { 138 | // Anonymous user => Set a hardcoded anonymous hash 139 | if (req.http.Cookie !~ "eZSESSID" && !req.http.authorization) { 140 | set req.http.X-User-Hash = "38015b703d82206ebc01d17a39c727e5"; 141 | } 142 | // Pre-authenticate request to get shared cache, even when authenticated 143 | else { 144 | set req.http.x-fos-original-url = req.url; 145 | set req.http.x-fos-original-accept = req.http.accept; 146 | set req.http.x-fos-original-cookie = req.http.cookie; 147 | // Clean up cookie for the hash request to only keep session cookie, as hash cache will vary on cookie. 148 | set req.http.cookie = ";" + req.http.cookie; 149 | set req.http.cookie = regsuball(req.http.cookie, "; +", ";"); 150 | set req.http.cookie = regsuball(req.http.cookie, ";(eZSESSID[^=]*)=", "; \1="); 151 | set req.http.cookie = regsuball(req.http.cookie, ";[^ ][^;]*", ""); 152 | set req.http.cookie = regsuball(req.http.cookie, "^[; ]+|[; ]+$", ""); 153 | 154 | set req.http.accept = "application/vnd.fos.user-context-hash"; 155 | set req.url = "/_fos_user_context_hash"; 156 | 157 | // Force the lookup, the backend must tell how to cache/vary response containing the user hash 158 | 159 | return (hash); 160 | } 161 | } 162 | 163 | // Rebuild the original request which now has the hash. 164 | if (req.restarts > 0 165 | && req.http.accept == "application/vnd.fos.user-context-hash" 166 | ) { 167 | set req.url = req.http.x-fos-original-url; 168 | set req.http.accept = req.http.x-fos-original-accept; 169 | set req.http.cookie = req.http.x-fos-original-cookie; 170 | 171 | unset req.http.x-fos-original-url; 172 | unset req.http.x-fos-original-accept; 173 | unset req.http.x-fos-original-cookie; 174 | 175 | // Force the lookup, the backend must tell not to cache or vary on the 176 | // user hash to properly separate cached data. 177 | 178 | return (hash); 179 | } 180 | } 181 | 182 | sub vcl_deliver { 183 | // On receiving the hash response, copy the hash header to the original 184 | // request and restart. 185 | if (req.restarts == 0 186 | && resp.http.content-type ~ "application/vnd.fos.user-context-hash" 187 | ) { 188 | set req.http.x-user-hash = resp.http.x-user-hash; 189 | 190 | return (restart); 191 | } 192 | 193 | // If we get here, this is a real response that gets sent to the client. 194 | 195 | // Remove the vary on context user hash, this is nothing public. Keep all 196 | // other vary headers. 197 | set resp.http.Vary = regsub(resp.http.Vary, "(?i),? *x-user-hash *", ""); 198 | set resp.http.Vary = regsub(resp.http.Vary, "^, *", ""); 199 | if (resp.http.Vary == "") { 200 | unset resp.http.Vary; 201 | } 202 | 203 | // Sanity check to prevent ever exposing the hash to a client. 204 | unset resp.http.x-user-hash; 205 | 206 | if (client.ip ~ debuggers) { 207 | if (obj.hits > 0) { 208 | set resp.http.X-Cache = "HIT"; 209 | set resp.http.X-Cache-Hits = obj.hits; 210 | } else { 211 | set resp.http.X-Cache = "MISS"; 212 | } 213 | } 214 | } 215 | -------------------------------------------------------------------------------- /dockerfiles/internal/varnish_prepare/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:jessie 2 | 3 | 4 | RUN apt-get update -y && apt-get install -y --force-yes \ 5 | php5 \ 6 | php5-mysql \ 7 | php5-json \ 8 | php5-xsl \ 9 | php5-intl \ 10 | php5-mcrypt \ 11 | php5-gd \ 12 | php5-curl \ 13 | patch 14 | 15 | 16 | ADD ezpublish.yml_varnishpurge.diff / 17 | ADD run.sh / 18 | 19 | WORKDIR /var/www 20 | 21 | 22 | CMD /run.sh 23 | -------------------------------------------------------------------------------- /dockerfiles/internal/varnish_prepare/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ aa$VARNISH_ENABLED == "aayes" ]; then 4 | 5 | VARNISH_IP=`cat /etc/hosts|grep -E '\svarnish$' | cut -f 1|head -n 1` 6 | echo VARNISH_IP=$VARNISH_IP 7 | 8 | if [ -f app/config/ezplatform.yml ]; then 9 | # Hack : let's patch the diff in case we have installed ezdemo_site_clean ( and not ezdemo_site ) 10 | # This is a workaround until config is injectable for http cache settings. 11 | cp /ezpublish.yml_varnishpurge.diff /ezpublish.yml_varnishpurge_patched.diff 12 | grep "ezdemo_site_clean_group:" app/config/ezplatform.yml && perl -pi -e "s|ezdemo_site_group:|ezdemo_site_clean_group:|" /ezpublish.yml_varnishpurge_patched.diff 13 | 14 | 15 | # apply patch, ignore patch if already applied and do not create any .rej files 16 | patch -p0 -N -r - < /ezpublish.yml_varnishpurge_patched.diff 17 | 18 | # Inject varnish' IP in ezpublish config 19 | perl -pi -e "s|^(.*)purge_servers:(.*)|\1purge_servers: [http://$VARNISH_IP:80]|" app/config/ezplatform.yml 20 | 21 | php app/console cache:clear --env=$SYMFONY_ENV 22 | else 23 | echo File do not exists : app/config/ezplatform.yml. Skipping injecting varnish IP 24 | fi 25 | fi 26 | 27 | -------------------------------------------------------------------------------- /dockerfiles/vardir/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM busybox 2 | 3 | add vardir.tar.gz /var/www/web 4 | # Make sure /var/www/ is also owned by ez user 5 | RUN chown 10000:10000 /var/www 6 | 7 | VOLUME [ "/var/www/web/var" ] 8 | 9 | CMD ["/bin/true"] 10 | 11 | -------------------------------------------------------------------------------- /files/auth.json-EXAMPLE: -------------------------------------------------------------------------------- 1 | { 2 | "http-basic": { 3 | "updates.ez.no": { 4 | "username": "", 5 | "password": "" 6 | } 7 | }, 8 | "github-oauth": { 9 | "github.com": "" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /files/authorized_keys2-EXAMPLE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ezsystems/ezpublish-docker/ed3925984d0f823be80bd84af1751c5508730682/files/authorized_keys2-EXAMPLE -------------------------------------------------------------------------------- /files/distro_containers.config-EXAMPLE: -------------------------------------------------------------------------------- 1 | 2 | 3 | source files/docker-compose.config-EXAMPLE 4 | source files/docker-compose.config 5 | 6 | 7 | DOCKER_REPOSITORY=myrepository.local:5000 8 | DOCKER_USER=ezsystems 9 | DOCKER_BUILDVER=0.1 10 | 11 | export DOCKER_REPOSITORY 12 | export DOCKER_BUILDVER 13 | export DOCKER_USER 14 | #export EZ_INSTALLTYPE 15 | -------------------------------------------------------------------------------- /files/docker-compose.config-EXAMPLE: -------------------------------------------------------------------------------- 1 | #### Project name #### 2 | 3 | # Prefix used by docker-compose when creating images and containers 4 | #export COMPOSE_PROJECT_NAME=ezpublishdocker 5 | 6 | #### DB settings #### 7 | 8 | # Password for the admin user in mariadb/mysql 9 | MYSQL_PASSWORD=youmaychangethis 10 | 11 | #### Varnish settings #### 12 | 13 | VARNISH_ENABLED=no 14 | 15 | #### eZ Publish deployment settings #### 16 | 17 | # Generates kickstart.ini file with database settings if true 18 | EZ_KICKSTART=true 19 | 20 | # Name of template file to use for generating a kickstart file 21 | # If value of setting is empty, a default kickstart file will be generated where db settings are stored ( given that EZ_KICKSTART=true ) 22 | # The template must contain "Server=", "Port=", "Database=", "User=" and "Password=" so that the values for these settings can be injected 23 | # Template file should be located in the files/ directory 24 | EZ_KICKSTART_FROM_TEMPLATE= 25 | 26 | # Setting used by docker-compose_ezpinstall.sh 27 | # Arguments to give to composer create-project, directory must be named '/var/www'! 28 | # Examples: 29 | # 30 | ## Latest eZ Publish Platform 5.4 Trial (requires valid authentication token: https://doc.ez.no/display/EZP/Using+Composer) 31 | ## EZ_COMPOSERPARAM="--prefer-dist --no-dev --repository-url=https://updates.ez.no/ttl ezsystems/ezpublish-community /var/www ~5.4.0" 32 | # 33 | ## Latest eZ Platform unstable release: 34 | ## EZ_COMPOSERPARAM="--prefer-dist --no-dev ezsystems/ezplatform /var/www ~0.9" 35 | # 36 | ## eZ Platform current development version: 37 | ## EZ_COMPOSERPARAM="--prefer-source ezsystems/ezplatform /var/www dev-master" 38 | # 39 | ## eZ Publish Community of a specific tag: 40 | ## EZ_COMPOSERPARAM="--prefer-dist --no-dev ezsystems/ezpublish-community /var/www v2014.11" 41 | # 42 | # By default pick latest release of eZ Platform: 43 | EZ_COMPOSERPARAM="--prefer-dist --no-dev ezsystems/ezplatform /var/www" 44 | 45 | # Set the environment for ezplatform. Valid options are "prod", "dev", "behat" 46 | # WARNING: Only non dev env works (assets) atm as the standard Nginx rewrite rules does not take care to addapt for env! 47 | SYMFONY_ENV=prod 48 | 49 | # SwiftMailer to inject into platform's parameters.yml 50 | EZ_MAILER_TRANSPORT= 51 | EZ_MAILER_HOST= 52 | EZ_MAILER_USER= 53 | EZ_MAILER_PASSWORD= 54 | 55 | #### Docker Compose settings #### 56 | # Path to location of docker-compose. If docker-compose is in your PATH, you may leave it empty 57 | export COMPOSE_EXECUTION_PATH="" 58 | 59 | #### Docker settings #### 60 | # This is the network address for the docker0 interface. This address is defined by docker and the setting here just needs to reflect that. 61 | # Docker defaults to the network address given here, so you should normally not need to change it 62 | DOCKER0NET="172.17.0.0/16" 63 | 64 | EZ_ENVIRONMENT="$SYMFONY_ENV" 65 | 66 | export MYSQL_PASSWORD 67 | export VARNISH_ENABLED 68 | export EZ_KICKSTART EZ_KICKSTART_FROM_TEMPLATE EZ_COMPOSERPARAM EZ_MAILER_TRANSPORT EZ_MAILER_HOST EZ_MAILER_USER EZ_MAILER_PASSWORD SYMFONY_ENV EZ_ENVIRONMENT 69 | export COMPOSE_EXECUTION_PATH 70 | export DOCKER0NET 71 | -------------------------------------------------------------------------------- /files/docker-compose.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Docker-Compose.sh 3 | After=docker.service 4 | Requires=docker.service 5 | 6 | [Service] 7 | TimeoutStartSec=0 8 | ExecStart=/vagrant/docker-compose.sh up -d --no-recreate 9 | #ExecStart=/opt/bin/a.sh 10 | WorkingDirectory=/vagrant 11 | User=core 12 | Restart=no 13 | 14 | [Install] 15 | WantedBy=multi-user.target 16 | -------------------------------------------------------------------------------- /files/kickstart.ini.with_demo_content: -------------------------------------------------------------------------------- 1 | # Kickstart configuration for the setup wizard 2 | # 3 | # DESCRIPTION 4 | # 5 | # In this file, installation parameters for each step 6 | # in the setup wizard can be specified. For example, by 7 | # providing the database connection parameters here, the 8 | # corresponding graphical user interface asking for the 9 | # database parameters will have the input forms pre-filled 10 | # or be skipped, using the values provided here. 11 | # 12 | # USAGE 13 | # 14 | # Initialization: 15 | # 16 | # Copy this file as kickstart.ini to the root of your 17 | # eZ Publish installation to enable this functionality. 18 | # 19 | # Installation Steps: 20 | # 21 | # For each step in the setup wizard asking for user input, 22 | # there exists a corresponding configuration block in this 23 | # file. The name of a configuration block is placed within 24 | # squared brackets. 25 | # 26 | # The available blocks are: 27 | # email_settings 28 | # database_choice 29 | # database_init 30 | # language_options 31 | # site_types 32 | # site_access 33 | # site_details 34 | # site_admin 35 | # security 36 | # registration 37 | # 38 | # Uncomment the blocks that you want kickstarted and 39 | # modify their parameter values as shown below. 40 | # 41 | # Parameter Values: 42 | # 43 | # Each parameter value is explained in details within a 44 | # configuration block. 45 | # 46 | # As a general convention, the following syntax is being 47 | # used to identify mandatory and optional parameters: 48 | # - Angle brackets mean that this parameter value 49 | # is mandatory 50 | # [string] - Squared brackets mean that this parameter value 51 | # is optional 52 | # 53 | # "Continue" Parameter: 54 | # 55 | # The "Continue" parameter specifies whether a certain step 56 | # in the setup wizard should be skipped: 57 | # Continue=false - Show the interface, pre-filled with the 58 | # values defined in kickstart.ini. This is the 59 | # default behaviour if "Continue" is commented. 60 | # Continue=true - Do not show the interface, instead continue 61 | # to the next one and use the values defined 62 | # in the kickstart configuration file. 63 | # 64 | # TROUBLESHOOTING 65 | # 66 | # Remove all leading whitespaces from uncommented 67 | # configuration blocks or parameters - otherwise the 68 | # settings will not be read properly by eZ Publish. 69 | # 70 | # Do not mix up optional parameter values and configuration 71 | # blocks, just because both use squared brackets! Optional 72 | # parameter values only appear after the equal (=) sign. 73 | 74 | [welcome] 75 | Continue=true 76 | 77 | [email_settings] 78 | # Continue= 79 | # Whether this step should continue after reading the data 80 | Continue=true 81 | # Type= 82 | # Type of email handler 83 | # : 84 | # - mta - Use Sendmail/MTA 85 | # - smtp - Use SMTP 86 | Type=smtp 87 | # Server= 88 | # Which server to use for SMTP 89 | #Server= 90 | # User= 91 | # Which user to use for SMTP 92 | #User= 93 | # Password= 94 | # Which password to use for SMTP 95 | #Password= 96 | 97 | #[database_choice] 98 | ## Continue= 99 | ## Whether this step should continue after reading the data 100 | #Continue=true 101 | ## Type= 102 | ## Which database system to use 103 | ## : 104 | ## - mysql - Use mysqli (MySQL Improved) 105 | ## - postgresql - Use postgresql 106 | ## other values are possible if provided by extension 107 | #Type=mysqli 108 | 109 | [database_init] 110 | # Continue= 111 | # Whether this step should continue after reading the data 112 | Continue=true 113 | # Server= 114 | # Which hostname has the database server 115 | Server= 116 | # Which port to connect to the database server 117 | Port= 118 | # Database= 119 | # Which database to use 120 | Database= 121 | # User= 122 | # Which user should be used in database 123 | User= 124 | # Server= 125 | # Which password should be used for user 126 | Password= 127 | # Socket= 128 | # Path to socket or empty for no socket 129 | Socket= 130 | 131 | [language_options] 132 | # Continue= 133 | # Whether this step should continue after reading the data 134 | Continue=true 135 | # Primary= 136 | # The primary language for the site 137 | Primary=eng-GB 138 | # Languages[]= 139 | # Additional languages 140 | Languages[] 141 | 142 | [site_types] 143 | # Continue= 144 | # Whether this step should continue after reading the data 145 | Continue=true 146 | # Site_package= 147 | # Which site package to install, package identifier 148 | Site_package=ezdemo_site 149 | 150 | [site_access] 151 | # Continue= 152 | # Whether this step should continue after reading the data 153 | Continue=true 154 | # Access= 155 | # : 156 | # - url - Use url/path for matching 157 | # - port - Use port for matching 158 | # - hostname - Use hostname for matching 159 | Access=url 160 | 161 | [site_details] 162 | # Continue= 163 | # Whether this step should continue after reading the data 164 | Continue=true 165 | # Title= 166 | # The site title 167 | # if not supplied it uses the site package name 168 | Title=eZ Publish Demo Site 169 | 170 | ## URL= 171 | ## The URL to use 172 | ## if not supplied it will generate it from the current url 173 | #URL= 174 | 175 | ## Access= 176 | ## The access name to use for user site 177 | ## if not supplied it will use site identifier 178 | #Access=news 179 | 180 | ## AdminAccess= 181 | ## The access name to use for admin site 182 | ## if not supplied it will use site identifier + _admin 183 | #AdminAccess=news_admin 184 | 185 | ## AccessPort= 186 | ## The access port to use for user page 187 | #AccessPort=8080 188 | 189 | ## AdminAccessPort= 190 | ## The access port to use for admin page 191 | #AdminAccessPort=8081 192 | 193 | ## AccessHostname= 194 | ## The access hostname to use for user page 195 | #AccessHostname=news.test.com 196 | 197 | ## AdminAccessHostname= 198 | ## The access hostname to use for admin page 199 | #AdminAccessHostname=news-admin.test.com 200 | 201 | ## Database= 202 | ## The database name to use for site 203 | Database= 204 | 205 | ## DatabaseAction= 206 | ## What to do with the database, can be one of: 207 | ## : 208 | ## - ignore 209 | ## Try to add entries without cleaning up 210 | ## - remove 211 | ## Clean up entries and add new ones 212 | ## - skip 213 | ## Do not insert database schema + data 214 | DatabaseAction=remove 215 | 216 | [site_admin] 217 | # Continue= 218 | # Whether this step should continue after reading the data 219 | Continue=true 220 | # FirstName=[string] 221 | # The first name of the administrator user 222 | FirstName=Administrator 223 | # LastName=[string] 224 | # The first name of the administrator user 225 | LastName=User 226 | # Email=[string] 227 | # The email address of the administrator user 228 | Email=nospam@ez.no 229 | # Password=[string] 230 | # The password of the administrator user 231 | Password=publish 232 | 233 | #[security] 234 | ## Continue= 235 | ## Whether this step should continue after reading the data 236 | #Continue=true 237 | 238 | [registration] 239 | ## Continue= 240 | ## Whether this step should continue after reading the data 241 | Continue=true 242 | ## Comments= 243 | ## Comment string to add to registration email 244 | #Comments= 245 | ## Send= 246 | ## Whether to send registration email or not 247 | #Send=false 248 | -------------------------------------------------------------------------------- /files/kickstart.ini.without_demo_content: -------------------------------------------------------------------------------- 1 | # Kickstart configuration for the setup wizard 2 | # 3 | # DESCRIPTION 4 | # 5 | # In this file, installation parameters for each step 6 | # in the setup wizard can be specified. For example, by 7 | # providing the database connection parameters here, the 8 | # corresponding graphical user interface asking for the 9 | # database parameters will have the input forms pre-filled 10 | # or be skipped, using the values provided here. 11 | # 12 | # USAGE 13 | # 14 | # Initialization: 15 | # 16 | # Copy this file as kickstart.ini to the root of your 17 | # eZ Publish installation to enable this functionality. 18 | # 19 | # Installation Steps: 20 | # 21 | # For each step in the setup wizard asking for user input, 22 | # there exists a corresponding configuration block in this 23 | # file. The name of a configuration block is placed within 24 | # squared brackets. 25 | # 26 | # The available blocks are: 27 | # email_settings 28 | # database_choice 29 | # database_init 30 | # language_options 31 | # site_types 32 | # site_access 33 | # site_details 34 | # site_admin 35 | # security 36 | # registration 37 | # 38 | # Uncomment the blocks that you want kickstarted and 39 | # modify their parameter values as shown below. 40 | # 41 | # Parameter Values: 42 | # 43 | # Each parameter value is explained in details within a 44 | # configuration block. 45 | # 46 | # As a general convention, the following syntax is being 47 | # used to identify mandatory and optional parameters: 48 | # - Angle brackets mean that this parameter value 49 | # is mandatory 50 | # [string] - Squared brackets mean that this parameter value 51 | # is optional 52 | # 53 | # "Continue" Parameter: 54 | # 55 | # The "Continue" parameter specifies whether a certain step 56 | # in the setup wizard should be skipped: 57 | # Continue=false - Show the interface, pre-filled with the 58 | # values defined in kickstart.ini. This is the 59 | # default behaviour if "Continue" is commented. 60 | # Continue=true - Do not show the interface, instead continue 61 | # to the next one and use the values defined 62 | # in the kickstart configuration file. 63 | # 64 | # TROUBLESHOOTING 65 | # 66 | # Remove all leading whitespaces from uncommented 67 | # configuration blocks or parameters - otherwise the 68 | # settings will not be read properly by eZ Publish. 69 | # 70 | # Do not mix up optional parameter values and configuration 71 | # blocks, just because both use squared brackets! Optional 72 | # parameter values only appear after the equal (=) sign. 73 | 74 | [welcome] 75 | Continue=true 76 | 77 | [email_settings] 78 | # Continue= 79 | # Whether this step should continue after reading the data 80 | Continue=true 81 | # Type= 82 | # Type of email handler 83 | # : 84 | # - mta - Use Sendmail/MTA 85 | # - smtp - Use SMTP 86 | Type=smtp 87 | # Server= 88 | # Which server to use for SMTP 89 | #Server= 90 | # User= 91 | # Which user to use for SMTP 92 | #User= 93 | # Password= 94 | # Which password to use for SMTP 95 | #Password= 96 | 97 | #[database_choice] 98 | ## Continue= 99 | ## Whether this step should continue after reading the data 100 | #Continue=true 101 | ## Type= 102 | ## Which database system to use 103 | ## : 104 | ## - mysql - Use mysqli (MySQL Improved) 105 | ## - postgresql - Use postgresql 106 | ## other values are possible if provided by extension 107 | #Type=mysqli 108 | 109 | [database_init] 110 | # Continue= 111 | # Whether this step should continue after reading the data 112 | Continue=true 113 | # Server= 114 | # Which hostname has the database server 115 | Server= 116 | # Which port to connect to the database server 117 | Port= 118 | # Database= 119 | # Which database to use 120 | Database= 121 | # User= 122 | # Which user should be used in database 123 | User= 124 | # Server= 125 | # Which password should be used for user 126 | Password= 127 | # Socket= 128 | # Path to socket or empty for no socket 129 | Socket= 130 | 131 | [language_options] 132 | # Continue= 133 | # Whether this step should continue after reading the data 134 | Continue=true 135 | # Primary= 136 | # The primary language for the site 137 | Primary=eng-GB 138 | # Languages[]= 139 | # Additional languages 140 | Languages[] 141 | 142 | [site_types] 143 | # Continue= 144 | # Whether this step should continue after reading the data 145 | Continue=true 146 | # Site_package= 147 | # Which site package to install, package identifier 148 | Site_package=ezdemo_site_clean 149 | 150 | [site_access] 151 | # Continue= 152 | # Whether this step should continue after reading the data 153 | Continue=true 154 | # Access= 155 | # : 156 | # - url - Use url/path for matching 157 | # - port - Use port for matching 158 | # - hostname - Use hostname for matching 159 | Access=url 160 | 161 | [site_details] 162 | # Continue= 163 | # Whether this step should continue after reading the data 164 | Continue=true 165 | # Title= 166 | # The site title 167 | # if not supplied it uses the site package name 168 | Title=eZ Publish Demo Site 169 | 170 | ## URL= 171 | ## The URL to use 172 | ## if not supplied it will generate it from the current url 173 | #URL= 174 | 175 | ## Access= 176 | ## The access name to use for user site 177 | ## if not supplied it will use site identifier 178 | #Access=news 179 | 180 | ## AdminAccess= 181 | ## The access name to use for admin site 182 | ## if not supplied it will use site identifier + _admin 183 | #AdminAccess=news_admin 184 | 185 | ## AccessPort= 186 | ## The access port to use for user page 187 | #AccessPort=8080 188 | 189 | ## AdminAccessPort= 190 | ## The access port to use for admin page 191 | #AdminAccessPort=8081 192 | 193 | ## AccessHostname= 194 | ## The access hostname to use for user page 195 | #AccessHostname=news.test.com 196 | 197 | ## AdminAccessHostname= 198 | ## The access hostname to use for admin page 199 | #AdminAccessHostname=news-admin.test.com 200 | 201 | ## Database= 202 | ## The database name to use for site 203 | Database= 204 | 205 | ## DatabaseAction= 206 | ## What to do with the database, can be one of: 207 | ## : 208 | ## - ignore 209 | ## Try to add entries without cleaning up 210 | ## - remove 211 | ## Clean up entries and add new ones 212 | ## - skip 213 | ## Do not insert database schema + data 214 | DatabaseAction=remove 215 | 216 | [site_admin] 217 | # Continue= 218 | # Whether this step should continue after reading the data 219 | Continue=true 220 | # FirstName=[string] 221 | # The first name of the administrator user 222 | FirstName=Administrator 223 | # LastName=[string] 224 | # The first name of the administrator user 225 | LastName=User 226 | # Email=[string] 227 | # The email address of the administrator user 228 | Email=nospam@ez.no 229 | # Password=[string] 230 | # The password of the administrator user 231 | Password=publish 232 | 233 | #[security] 234 | ## Continue= 235 | ## Whether this step should continue after reading the data 236 | #Continue=true 237 | 238 | [registration] 239 | ## Continue= 240 | ## Whether this step should continue after reading the data 241 | Continue=true 242 | ## Comments= 243 | ## Comment string to add to registration email 244 | #Comments= 245 | ## Send= 246 | ## Whether to send registration email or not 247 | #Send=false 248 | -------------------------------------------------------------------------------- /files/user-data-EXAMPLE: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | 3 | coreos: 4 | etcd: 5 | # generate a new token for each unique cluster from https://discovery.etcd.io/new 6 | # WARNING: replace each time you 'vagrant destroy' 7 | discovery: https://discovery.etcd.io/ 8 | addr: $public_ipv4:4001 9 | peer-addr: $public_ipv4:7001 10 | units: 11 | - name: etcd.service 12 | command: start 13 | -------------------------------------------------------------------------------- /files/user-data-EXAMPLE-AWS: -------------------------------------------------------------------------------- 1 | #cloud-config 2 | 3 | coreos: 4 | etcd: 5 | # generate a new token for each unique cluster from https://discovery.etcd.io/new 6 | # WARNING: replace each time you 'vagrant destroy' 7 | discovery: https://discovery.etcd.io/ 8 | addr: $private_ipv4:4001 9 | peer-addr: $private_ipv4:7001 10 | units: 11 | - name: etcd.service 12 | command: start 13 | -------------------------------------------------------------------------------- /files/vagrant.yml-EXAMPLE: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | virtualmachine: 4 | # If you do not intend to install ezplatform using composer, you'll likely do fine with 512 or 756 5 | ram: 2048 6 | cpus: 1 7 | timezone: CET 8 | gui: false 9 | coreos_channel: stable 10 | hostname: ezpublish-docker 11 | 12 | network: 13 | private_network_ip: 33.33.33.53 14 | 15 | aws: 16 | use_aws: false 17 | access_key_id: FOO 18 | secret_access_key: BAR 19 | region: eu-west-1 20 | instance_type: t2.small 21 | subnet_id: subnet-foobar 22 | associate_public_ip: "true" 23 | # If using elastic_ip, then provide the allocation ID, not the IP itself. And set associate_public_ip to "false" 24 | # Note that elastic_ip requires vagrant-aws plugin version 0.5.1 or later 25 | elastic_ip: false 26 | security_groups: ["sg-foobar"] 27 | keypair_name: foobarkey 28 | block_device_mapping: 29 | device_name: "/dev/xvda" 30 | volume_size: 12 31 | # Overview over AMIs : https://coreos.com/docs/running-coreos/cloud-providers/ec2/ 32 | # coreOS PV: 33 | ami: ami-d6b80ba1 34 | # coreos HVM: 35 | #ami: ami-58e14e2f 36 | 37 | debug: 38 | disable_rsync: false 39 | disable_docker_provision: false 40 | # Copy customer authorized_keys2 to coreOS VM or not. Makes it possible to ssh directly to VM without doing a "vagrant ssh" 41 | copy_authorized_keys2: false 42 | 43 | 44 | -------------------------------------------------------------------------------- /resources/database_character_set.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | echo "Altering database, setting character set to utf8" 3 | echo "ALTER DATABASE ${MYSQL_DATABASE} CHARACTER SET utf8 COLLATE utf8_general_ci;" | "${mysql[@]}" 4 | 5 | -------------------------------------------------------------------------------- /resources/docker-compose: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ezsystems/ezpublish-docker/ed3925984d0f823be80bd84af1751c5508730682/resources/docker-compose -------------------------------------------------------------------------------- /resources/docker-compose_url.txt: -------------------------------------------------------------------------------- 1 | # Downloaded docker-compose using: 2 | curl -L https://github.com/docker/compose/releases/download/1.3.1/docker-compose-`uname -s`-`uname -m` > docker-compose 3 | -------------------------------------------------------------------------------- /resources/ezpublish.yml_varnishpurge.diff: -------------------------------------------------------------------------------- 1 | --- app/config/ezplatform.yml.org 2015-01-20 14:32:40.287422725 +0000 2 | +++ app/config/ezplatform.yml 2015-01-20 14:32:56.191423023 +0000 3 | @@ -15,6 +15,10 @@ 4 | ezdemo_site_admin: 5 | legacy_mode: true 6 | ezpublish: 7 | + http_cache: 8 | + # As of 5.4 only use "http" 9 | + # "single_http" and "multiple_http" are deprecated but will still work. 10 | + purge_type: http 11 | imagemagick: 12 | enabled: false 13 | repositories: 14 | @@ -36,6 +40,9 @@ 15 | URIElement: '1' 16 | system: 17 | ezdemo_site_group: 18 | + http_cache: 19 | + # Fill in your Varnish server(s) address(es). 20 | + purge_servers: [http://varnishserver:80] 21 | repository: eng_repository 22 | languages: 23 | - eng-GB 24 | -------------------------------------------------------------------------------- /resources/motd_ez_welcome.conf: -------------------------------------------------------------------------------- 1 | 2 | Welcome to eZ Platform/Studio(/Publish 5.3+) VM using Docker! 3 | 4 | 5 | Orientation: 6 | 7 | This is inception level 1, inception level 2 is when you open terminal against containers! 8 | 9 | 10 | Web info: 11 | 12 | Ip address of this machine is configurable in vagrant.yml, default is: 13 | http://33.33.33.53:8080 14 | 15 | Tip: To access Platform UI backend type in `/shell` after this address. 16 | 17 | 18 | Cli info: 19 | 20 | To check content of the project/app directory, go to: 21 | $ cd /vagrant/volumes/ezpublish 22 | 23 | Inside ezpphp containers you'll find it in: 24 | $ cd /var/www 25 | 26 | To see running containers and their names: 27 | $ docker ps 28 | 29 | To run any kind of command on a running container: 30 | $ docker exec 31 | 32 | Example, run bash to be able to check out things in a container: 33 | $ docker exec -ti bash 34 | 35 | Tip: Most containers does not have things like Vim. Using bash, install it using: 36 | $ apt-get install vim 37 | 38 | 39 | Examples: 40 | 41 | Run Symfony console commands: 42 | $ docker exec -u ez -ti ezpublishdocker_phpfpm1_1 php app/console list 43 | 44 | Composer update with new instance with same db/disk + mount composer cache volume: 45 | $ docker run -u ez -ti --volumes-from=ezpublishdocker_composercachevol_1 \ 46 | --volumes-from=ezpublishdocker_ezpublishvol_1 \ 47 | --link=ezpublishdocker_db1_1:db \ 48 | ezpublishdocker_ezpphp:latest composer update 49 | 50 | Using mysql client to work on the database: 51 | $ docker exec -ti ezpublishdocker_db1_1 bash 52 | $ export TERM=dumb 53 | $ mysql --user=${MYSQL_USER} --password=${MYSQL_PASSWORD} ezp 54 | -------------------------------------------------------------------------------- /vagrant-aws.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 4 | 5 | tmpscript=`mktemp -p /tmp` 6 | cat < $tmpscript 7 | #!/bin/bash 8 | 9 | cd /vagrant 10 | EOT 11 | echo vagrant "$@" >> $tmpscript 12 | chmod a+x $tmpscript 13 | 14 | username=`whoami` 15 | uid=`id -u` 16 | gid=`id -g` 17 | gname=`id -g --name` 18 | 19 | #docker run -i -t --rm --volume $SCRIPTDIR:/vagrant --volume $tmpscript:/tmp/vagrant_execute.sh --volume $HOME/.ssh:/home/$username/.ssh ezpublishdocker_vagrantaws:latest bash -c "groupadd $gname --gid $gid; useradd $username --uid $uid --gid $gid; chown $username:$gname /home/$username; mv /root/.vagrant.d /home/$username/; chown -R $username:$gname /home/$username/.vagrant.d; cd /vagrant; sudo -i -u $username bash" 20 | docker run -i -t --rm --volume $SCRIPTDIR:/vagrant --volume $tmpscript:/tmp/vagrant_execute.sh --volume $HOME/.ssh:/home/$username/.ssh ezpublishdocker_vagrantaws:latest bash -c "groupadd $gname --gid $gid; useradd $username --uid $uid --gid $gid; chown $username:$gname /home/$username; mv /root/.vagrant.d /home/$username/; chown -R $username:$gname /home/$username/.vagrant.d; cd /vagrant; sudo -i -u $username /tmp/vagrant_execute.sh" 21 | 22 | rm $tmpscript 23 | -------------------------------------------------------------------------------- /volumes/composercache/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ezsystems/ezpublish-docker/ed3925984d0f823be80bd84af1751c5508730682/volumes/composercache/.keep -------------------------------------------------------------------------------- /volumes/ezpublish/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ezsystems/ezpublish-docker/ed3925984d0f823be80bd84af1751c5508730682/volumes/ezpublish/.keep -------------------------------------------------------------------------------- /volumes/mysql/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ezsystems/ezpublish-docker/ed3925984d0f823be80bd84af1751c5508730682/volumes/mysql/.keep --------------------------------------------------------------------------------