├── .gitattributes ├── .gitignore ├── .travis.yml ├── Jenkinsfile ├── LICENSE ├── README.md ├── cli ├── Dockerfile └── docker-entrypoint.sh ├── conf └── nginx.conf ├── docker-compose.php5-fpm.yml ├── docker-compose.yml ├── kubernetes ├── k8swordpress.sh ├── local-volumes.yaml ├── mysql-deployment.yaml ├── password.txt ├── wordpress-deployment.yaml └── wordpress-ingress.yaml ├── nginx ├── Dockerfile ├── docker-entrypoint.sh ├── nginx.conf └── wordpress.conf ├── php5-fpm └── Dockerfile ├── php7-fpm └── Dockerfile └── wordpress_architecture.png /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | *.txt text 4 | *.vcproj text eol=crlf 5 | *.sh text eol=lf 6 | *.ps1 text eol=crlf 7 | 8 | # Custom for Visual Studio 9 | *.cs diff=csharp 10 | 11 | # Explicitly declare text files you want to always be normalized and converted 12 | # to native line endings on checkout. 13 | *.c text 14 | *.h text 15 | 16 | # Declare files that will always have CRLF line endings on checkout. 17 | *.sln text eol=crlf 18 | 19 | # Denote all files that are truly binary and should not be modified. 20 | *.png binary 21 | *.jpg binary 22 | 23 | # Standard to msysgit 24 | *.doc diff=astextplain 25 | *.DOC diff=astextplain 26 | *.docx diff=astextplain 27 | *.DOCX diff=astextplain 28 | *.dot diff=astextplain 29 | *.DOT diff=astextplain 30 | *.pdf diff=astextplain 31 | *.PDF diff=astextplain 32 | *.rtf diff=astextplain 33 | *.RTF diff=astextplain -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear in the root of a volume 35 | .DocumentRevisions-V100 36 | .fseventsd 37 | .Spotlight-V100 38 | .TemporaryItems 39 | .Trashes 40 | .VolumeIcon.icns 41 | 42 | # Directories potentially created on remote AFP share 43 | .AppleDB 44 | .AppleDesktop 45 | Network Trash Folder 46 | Temporary Items 47 | .apdisk 48 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | env: 2 | global: 3 | # Docker Repository 4 | - REPO=fjudith/wordpress 5 | # Compute docker tag 6 | - TAG=`if [ "${TRAVIS_BRANCH}" == "master" ]; then echo "latest"; else echo ${TRAVIS_BRANCH}-fpm ; fi` 7 | - PHP5=`if [ "${TRAVIS_BRANCH}" == "master" ]; then echo "php5-fpm"; else echo ${TRAVIS_BRANCH}-php5-fpm ; fi` 8 | - PHP7=`if [ "${TRAVIS_BRANCH}" == "master" ]; then echo "php7-fpm"; else echo ${TRAVIS_BRANCH}-php7.1-fpm ; fi` 9 | - NGINX=`if [ "${TRAVIS_BRANCH}" == "master" ]; then echo "nginx"; else echo ${TRAVIS_BRANCH}-nginx ; fi` 10 | - CLI=`if [ "${TRAVIS_BRANCH}" == "master" ]; then echo "cli"; else echo ${TRAVIS_BRANCH}-cli ; fi` 11 | # Retreive commit ID 12 | - COMMIT=${TRAVIS_COMMIT::8} 13 | - secure: "rLhPLS9ZvT0kovidLhouHGhoNK2jZKPP9h6om4QPlwtUuVRnMG1HOwZV6RnUkdTAZUkhvLeAk+3atHObtDaTi86yqBIPyi4cjoF8y5QV4BEJmZcpNs9ECWJRHpeYjJqY1lrGCnxBnSMR5ldI55FR+jtVo9PbARrDuIcwOf+irQ39nG+NRPqYfNjo4TG1QWQdqfF6HOIkOU9BTexy2blbOOEDpinh8U+v9tiqh6aToLP/t8B2aY9NP1Mn6MHQK2ALdk79RDjzgjNsm7A/h+Os9CW3CBwYpK/EVhZjYo46ebu/G++JmWjUJW1VamMHJLILoRVWhxgW1CQTKhABYL0di7xEhz6Ose6NQWAS4wCe42so7o1U/AgoavyzKO1kk9q9f7zFS8BXlDgiu2dbtNUMa4uj/g3EcsVDzx7W6pctq6Mx1KrsytaG3065qBbPnRrN20HWY3DyODL4Tq+iDcWiqpYbQMQaYPNALg7N3iC1R+iUmbwd2TqmXvKtDz5Z5spWXyqw+jEoxQ1YL5DIUbquUHDUjwGAX7OBSgD5cAjrjd8PBMt2qGmbAsE/mb0akmbP19Sfn+wjyUvKJ2FjIONEuZX3+0LUFHmbbt2EzWho7BmeON9WJcqziAvJwc6FJy9u9RQa4VkhPsY5f0IeCdUhmJ3kcnH5gk6DSMnPhcYWqQs=" 14 | - secure: "dEafQqIPkK6y07TG3d+nf6VI4VQwjXs9HZJ8hctWHcmGt4kQoER+6rg1WIW0JVeg6gKMPfch4kyl2ciwQd+9/49D8Bv0K3yLRY86d2lzB1iRe8TzTUxhJ6Exz7vMDsMtyBBbh03UGgtyXwMk7iloDyvd4Solx4ojjrVFjFX2XobsoIh+TfL8zwjfUOPo6NWJ7QqZddNoZ1KBBW8FzphnVgpsXIKZwRJmwI9+ILr7K6AbxgxFcqaFFL+dboSyE+IwK5ps3habnS4bIbq92hENDDt2zrY7RAEEa7fgN7EjY8pHot60ZYhbYsOtBA9ba4fKEwFauGWIEHB4Z8tsMDGExVEh/1dOsFvblEuHJNnmmOQeB90PRfoZ1sellWnIqw5/e4QZeQEALMAmh7lfUdAWQ2rfXBl4e7Vde7k7fYTohalvmub5ULWRzR3y4+DgQZsID7g8c2C1NEhNGVoCGX96h1C9PIMBOtqBGxY5fZqd2dCxoE0MZjiCPI6psaM3x1B34t2lzsUY3SRWc6rzbV8LpmBIXoxX66jb9fLZJg30RIb9NKrA6FIxU2pGxK9d4H6OL7tdiStCpDaAFIiH3CwpYgp0tuN5ZZ+y8WcsAShvf1T/tBtfyHITWPiFc9kw25kYEvjUl+9dGTqeP1rGcPHys/8ohYgm3ST0Q7iS2YqPgB4=" 15 | 16 | 17 | sudo: required 18 | services: 19 | - docker 20 | 21 | 22 | before_install: 23 | # BUILD 24 | # 25 | # php5-fpm: build 26 | - docker build -f php5-fpm/Dockerfile -t ${REPO}:${COMMIT}-php5-fpm php5-fpm/ 27 | # php7-fpm: build 28 | - docker build -f php7-fpm/Dockerfile -t ${REPO}:${COMMIT}-php7-fpm php7-fpm/ 29 | # nginx: build 30 | - docker build -f nginx/Dockerfile -t ${REPO}:${COMMIT}-nginx nginx/ 31 | # nginx: cli 32 | - docker build -f cli/Dockerfile -t ${REPO}:${COMMIT}-cli cli/ 33 | # RUN 34 | # 35 | ## php5: network 36 | docker network create wordpress-php5 37 | ## php5: mariadb 38 | - docker run -d --name "php5-md-${TRAVIS_BUILD_NUMBER}" \ 39 | --network wordpress-php5 \ 40 | -e MYSQL_DATABASE=wordpress \ 41 | -e MYSQL_ROOT_PASSWORD=Ch4ng3m3 \ 42 | -e MYSQL_USER=wordpress \ 43 | -e MYSQL_PASSWORD=Ch4ng3m3 \ 44 | mariadb 45 | ## php5: memcached 46 | - docker run -d --name "php5-mc-${TRAVIS_BUILD_NUMBER}" memcached 47 | ## php5: fpm 48 | - sleep 15 49 | - docker run -d --name "php5-fpm-${TRAVIS_BUILD_NUMBER}" 50 | --network wordpress-php5 \ 51 | -v php5-data:/var/www/html \ 52 | -e WORDPRESS_DB_HOST=mariadb \ 53 | -e WORDPRESS_DB_NAME=wordpress \ 54 | -e WORDPRESS_DB_USER=wordpress \ 55 | -e WORDPRESS_DB_PASSWORD=Ch4ng3m3 \ 56 | ${REPO}:${COMMIT}-php5-fpm 57 | ## php5: nginx 58 | - docker run -d --name "php5-nginx-${TRAVIS_BUILD_NUMBER}" \ 59 | --network wordpress-php5 \ 60 | -v php5-data:/var/www/html \ 61 | ${REPO}:${COMMIT}-nginx 62 | ## php7: network 63 | docker network create wordpress-php7 64 | ## php7: mariadb 65 | - docker run -d --name "php7-md-${TRAVIS_BUILD_NUMBER}" \ 66 | --network wordpress-php7 \ 67 | -e MYSQL_DATABASE=wordpress \ 68 | -e MYSQL_ROOT_PASSWORD=Ch4ng3m3 \ 69 | -e MYSQL_USER=wordpress \ 70 | -e MYSQL_PASSWORD=Ch4ng3m3 \ 71 | mariadb 72 | ## php7: memcached 73 | - docker run -d --name "php7-mc-${TRAVIS_BUILD_NUMBER}" memcached 74 | ## php7: fpm 75 | - sleep 15 76 | - docker run -d --name "php7-fpm-${TRAVIS_BUILD_NUMBER}" \ 77 | --network wordpress-php7 \ 78 | -v php7-data:/var/www/html \ 79 | -e WORDPRESS_DB_HOST=mariadb \ 80 | -e WORDPRESS_DB_NAME=wordpress \ 81 | -e WORDPRESS_DB_USER=wordpress \ 82 | -e WORDPRESS_DB_PASSWORD=Ch4ng3m3 \ 83 | ${REPO}:${COMMIT}-php7-fpm 84 | ## php7: nginx 85 | - docker run -d --name "php7-nginx-${TRAVIS_BUILD_NUMBER}" \ 86 | -v php7-data:/var/www/html \ 87 | ${REPO}:${COMMIT}-nginx 88 | ## php7: cli 89 | - docker run -d --name "php7-cli-${TRAVIS_BUILD_NUMBER}" \ 90 | -v php7-data:/var/www/html \ 91 | ${REPO}:${COMMIT}-cli 92 | 93 | 94 | script: 95 | # wait 15 seconds for application initialization 96 | # php5: test 97 | - docker run --rm --network wordpress-php5 \ 98 | phusion/baseimage \ 99 | /bin/bash -c "curl -ik -L http://php5-nginx-${TRAVIS_BUILD_NUMBER}:80" 100 | # php7: test 101 | - docker run --rm --network wordpress-php7 \ 102 | phusion/baseimage \ 103 | /bin/bash -c "curl -ik -L http://php7-nginx-${TRAVIS_BUILD_NUMBER}:80" 104 | 105 | 106 | after_success: 107 | - docker login -u $DOCKER_USER -p $DOCKER_PASS 108 | # latest 109 | - docker tag ${REPO}:${COMMIT}-php5-fpm ${REPO}:${TAG} 110 | # php5 111 | - docker tag ${REPO}:${COMMIT}-php5-fpm ${REPO}:${PHP5} 112 | - docker tag ${REPO}:${COMMIT}-php5-fpm ${REPO}:travis-${TRAVIS_BUILD_NUMBER}-php5-fpm 113 | # php7 114 | - docker tag ${REPO}:${COMMIT}-php7-fpm ${REPO}:${PHP7} 115 | - docker tag ${REPO}:${COMMIT}-php7-fpm ${REPO}:travis-${TRAVIS_BUILD_NUMBER}-php7-fpm 116 | # nginx 117 | - docker tag ${REPO}:${COMMIT}-nginx ${REPO}:${NGINX} 118 | - docker tag ${REPO}:${COMMIT}-nginx ${REPO}:travis-${TRAVIS_BUILD_NUMBER}-nginx 119 | # cli 120 | - docker tag ${REPO}:${COMMIT}-cli ${REPO}:${CLI} 121 | - docker tag ${REPO}:${COMMIT}-cli ${REPO}:travis-${TRAVIS_BUILD_NUMBER}-cli 122 | # push to public registry 123 | - docker push ${REPO} -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | // 2 | // https://github.com/jenkinsci/pipeline-model-definition-plugin/wiki/Syntax-Reference 3 | // https://jenkins.io/doc/book/pipeline/syntax/#parallel 4 | // https://jenkins.io/doc/book/pipeline/syntax/#post 5 | pipeline { 6 | agent any 7 | environment { 8 | REPO = 'fjudith/wordpress' 9 | PRIVATE_REPO = "${PRIVATE_REGISTRY}/${REPO}" 10 | DOCKER_PRIVATE = credentials('docker-private-registry') 11 | } 12 | stages { 13 | stage ('Checkout') { 14 | steps { 15 | script { 16 | COMMIT = "${GIT_COMMIT.substring(0,8)}" 17 | 18 | if ("${BRANCH_NAME}" == "master"){ 19 | TAG = "latest" 20 | NGINX = "nginx" 21 | FPM = "fpm" 22 | CLI = "cli" 23 | } 24 | else { 25 | TAG = "${BRANCH_NAME}" 26 | NGINX = "${BRANCH_NAME}-nginx" 27 | FPM = "${BRANCH_NAME}-php7.1-fpm" 28 | CLI = "${BRANCH_NAME}-cli" 29 | } 30 | } 31 | sh 'printenv' 32 | } 33 | } 34 | stage ('Docker build Micro-Service') { 35 | parallel { 36 | stage ('Wodpress Nginx'){ 37 | agent { label 'docker'} 38 | steps { 39 | sh "docker build -f nginx/Dockerfile -t ${REPO}:${COMMIT}-nginx nginx/" 40 | } 41 | post { 42 | success { 43 | echo 'Tag for private registry' 44 | sh "docker tag ${REPO}:${COMMIT}-nginx ${PRIVATE_REPO}:${NGINX}" 45 | } 46 | } 47 | } 48 | stage ('Wordpress PHP-FPM') { 49 | agent { label 'docker'} 50 | steps { 51 | sh "docker build -f php7-fpm/Dockerfile -t ${REPO}:${COMMIT}-fpm php7-fpm/" 52 | } 53 | post { 54 | success { 55 | echo 'Tag for private registry' 56 | sh "docker tag ${REPO}:${COMMIT}-fpm ${PRIVATE_REPO}:${FPM}" 57 | } 58 | } 59 | } 60 | stage ('Wordpress CLI') { 61 | agent { label 'docker'} 62 | steps { 63 | sh "docker build -f cli/Dockerfile -t ${REPO}:${COMMIT}-cli cli/" 64 | } 65 | post { 66 | success { 67 | echo 'Tag for private registry' 68 | sh "docker tag ${REPO}:${COMMIT}-cli ${PRIVATE_REPO}:${CLI}" 69 | } 70 | } 71 | } 72 | } 73 | } 74 | stage ('Run'){ 75 | parallel { 76 | stage ('Micro-Services'){ 77 | agent { label 'docker'} 78 | steps { 79 | // Create Network 80 | sh "docker network create wordpress-micro-${BUILD_NUMBER}" 81 | // Start database 82 | sh "docker run -d --name 'mariadb-${BUILD_NUMBER}' -e MYSQL_ROOT_PASSWORD=wordpress -e MYSQL_USER=wordpress -e MYSQL_PASSWORD=wordpress -e MYSQL_DATABASE=wordpress --network wordpress-micro-${BUILD_NUMBER} amd64/mariadb:10.0" 83 | sleep 15 84 | // Start Memcached 85 | sh "docker run -d --name 'memcached-${BUILD_NUMBER}' --network wordpress-micro-${BUILD_NUMBER} memcached" 86 | // Start application micro-services 87 | sh "docker run -d --name 'fpm-${BUILD_NUMBER}' --link mariadb-${BUILD_NUMBER}:mariadb --link memcached-${BUILD_NUMBER}:memcached --network wordpress-micro-${BUILD_NUMBER} -v wordpress-micro-data:/var/www/html ${REPO}:${COMMIT}-fpm" 88 | sh "docker run -d --name 'nginx-${BUILD_NUMBER}' --link fpm-${BUILD_NUMBER}:wordpress --link memcached-${BUILD_NUMBER}:memcached --network wordpress-micro-${BUILD_NUMBER} -v wordpress-micro-data:/var/www/html ${REPO}:${COMMIT}-nginx" 89 | // Get container IDs 90 | script { 91 | DOCKER_FPM = sh(script: "docker ps -qa -f ancestor=${REPO}:${COMMIT}-fpm", returnStdout: true).trim() 92 | DOCKER_NGINX = sh(script: "docker ps -qa -f ancestor=${REPO}:${COMMIT}-nginx", returnStdout: true).trim() 93 | } 94 | } 95 | } 96 | } 97 | } 98 | stage ('Test'){ 99 | parallel { 100 | stage ('Micro-Services'){ 101 | agent { label 'docker'} 102 | steps { 103 | sleep 20 104 | sh "docker logs nginx-${BUILD_NUMBER}" 105 | // External 106 | sh "docker run --rm --network wordpress-micro-${BUILD_NUMBER} blitznote/debootstrap-amd64:17.04 bash -c 'curl -iL -X GET http://${DOCKER_NGINX}:80'" 107 | } 108 | post { 109 | always { 110 | echo 'Remove micro-services stack' 111 | 112 | sh "docker rm -fv nginx-${BUILD_NUMBER}" 113 | sh "docker rm -fv fpm-${BUILD_NUMBER}" 114 | sh "docker rm -fv memcached-${BUILD_NUMBER}" 115 | sh "docker rm -fv mariadb-${BUILD_NUMBER}" 116 | sleep 10 117 | sh "docker network rm wordpress-micro-${BUILD_NUMBER}" 118 | } 119 | success { 120 | sh "docker login -u ${DOCKER_PRIVATE_USR} -p ${DOCKER_PRIVATE_PSW} ${PRIVATE_REGISTRY}" 121 | sh "docker push ${PRIVATE_REPO}:${FPM}" 122 | sh "docker push ${PRIVATE_REPO}:${NGINX}" 123 | sh "docker push ${PRIVATE_REPO}:${CLI}" 124 | } 125 | } 126 | } 127 | } 128 | } 129 | } 130 | post { 131 | always { 132 | echo 'Run regardless of the completion status of the Pipeline run.' 133 | } 134 | changed { 135 | echo 'Only run if the current Pipeline run has a different status from the previously completed Pipeline.' 136 | } 137 | success { 138 | echo 'Only run if the current Pipeline has a "success" status, typically denoted in the web UI with a blue or green indication.' 139 | 140 | } 141 | unstable { 142 | echo 'Only run if the current Pipeline has an "unstable" status, usually caused by test failures, code violations, etc. Typically denoted in the web UI with a yellow indication.' 143 | } 144 | aborted { 145 | echo 'Only run if the current Pipeline has an "aborted" status, usually due to the Pipeline being manually aborted. Typically denoted in the web UI with a gray indication.' 146 | } 147 | } 148 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | docker-wordpress 635 | Copyright (C) 2016 JUDITH Florian 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | docker-wordpress Copyright (C) 2016 JUDITH Florian 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/fjudith/docker-wordpress.svg?branch=master)](https://travis-ci.org/fjudith/docker-wordpress) 2 | 3 | ![Architecture & Distribution](https://github.com/fjudith/docker-wordpress/raw/master/wordpress_architecture.png) 4 | 5 | # Introduction 6 | 7 | This Docker image adds LDAP and Memcached PHP Extension to [official Wordpress fpm image](https://hub.docker.com/_/wordpress/) for WordPress plugins. 8 | 9 | [`5.1.1-fpm`, `latest`](https://github.com/fjudith/docker-wordpress/tree/5.1.1-fpm) 10 | [`4.9.1-fpm`](https://github.com/fjudith/docker-wordpress/tree/4.9.1-fpm) 11 | [`4.8.3-fpm`](https://github.com/fjudith/docker-wordpress/tree/4.8.3-fpm) 12 | [`4.8.0-fpm`](https://github.com/fjudith/docker-wordpress/tree/4.8.0-fpm) 13 | [`4.7.3-fpm`](https://github.com/fjudith/docker-wordpress/tree/4.7.3-fpm) 14 | 15 | # Roadmap 16 | 17 | * [x] Add wp-cli running php7.1-cli official image based on debian 18 | * [x] Enable WP-CACHE in wp-config.php 19 | * [x] Build & Validate using Travis CI and Jenkins CI 20 | * [x] Add WP-FFPC plugin for object caching to Memcached 21 | * [x] Add Simple-Ldap-Login plugin for LDAP/AD authentication 22 | * [x] Enable HTTP/2 support in Nginx 23 | 24 | ## Production deployment 25 | 26 | > Note: The `cli` container will be flapping until the Wordpress site configured. 27 | 28 | ```yml 29 | version: '2' 30 | volumes: 31 | wordpress-db: 32 | wordpress-data: 33 | 34 | services: 35 | mariadb: 36 | image: amd64/mariadb:10.2 37 | environment: 38 | MYSQL_DATABASE: wordpress 39 | MYSQL_PASSWORD: Chang3M3 40 | MYSQL_ROOT_PASSWORD: Change3M34ls0 41 | MYSQL_USER: wordpress 42 | volumes: 43 | - wordpress-db:/var/lib/mysql 44 | 45 | memcached: 46 | image: amd64/memcached:1.5 47 | 48 | nginx: 49 | build: nginx/ 50 | image: fjudith/wordpress:nginx 51 | ports: 52 | - 32716:443/tcp 53 | - 32715:80/tcp 54 | links: 55 | - memcached:memcached 56 | - wordpress:wordpress 57 | volumes: 58 | - wordpress-data:/var/www/html:rw 59 | 60 | wordpress: 61 | build: php7-fpm/ 62 | image: fjudith/wordpress:php7-fpm 63 | environment: 64 | WORDPRESS_DB_HOST: mysql 65 | WORDPRESS_DB_NAME: wordpress 66 | WORDPRESS_DB_USER: wordpress 67 | WORDPRESS_DB_PASSWORD: Chang3M3 68 | links: 69 | - memcached:memcached 70 | - mariadb:mysql 71 | volumes: 72 | - wordpress-data:/var/www/html 73 | 74 | cli: 75 | build: cli/ 76 | image: fjudith/wordpress:cli 77 | stdin_open: true 78 | tty: true 79 | depends_on: 80 | - mariadb 81 | - wordpress 82 | links: 83 | - mariadb:mysql 84 | volumes: 85 | - wordpress-data:/var/www/html 86 | ``` 87 | 88 | ## Enable Object Caching 89 | 90 | Once the initial site configuration performed, navigate to `Plugins`, activate `WP-FFPC` and click `Settings`. 91 | Set the following minimal configuration options: 92 | 93 | * **Cache Type/Select Backend**: PHP Memcached 94 | * **Backend Settings/Hosts**: memcached:11211 95 | * **Backend Settings/Authentication: username**: _Empty_ 96 | * **Backend Settings/Authentication: password**: _Empty_ 97 | * **Backend Settings/Enable memcached binary mode**: **Activated** 98 | 99 | ## Updating 100 | 101 | Because the `docker-compose` levegare persistent volume in the Wordpress root directory, its required to open a session in the `cli` container in order to run the command `wp core update`. 102 | 103 | ### Interactive 104 | 105 | Open a terminal session in the `cli` container. 106 | 107 | ```bash 108 | WP_CLI=$(docker ps -qa -f ancestor=fjudith/wordpress:cli) 109 | docker container exec -it ${WP_CLI} bash 110 | ``` 111 | 112 | Run the following commands to update the application engine, the plugins and themes. 113 | 114 | ```bash 115 | wp core update 116 | wp plugins update --all 117 | wp theme update --all 118 | ``` 119 | 120 | ### Non-interactive 121 | 122 | Run the following commands 123 | 124 | ```bash 125 | WP_CLI=$(docker ps -qa -f ancestor=fjudith/wordpress:cli) 126 | docker container exec ${WP_CLI} bash -c 'wp core update && wp plugins update --all && wp theme update --all' 127 | ``` 128 | 129 | # References 130 | https://wooster.checkmy.ws/2015/10/wordpress-docker/ 131 | https://ejosh.co/de/2015/08/wordpress-and-docker-the-correct-way/ 132 | https://github.com/docker-library/php/issues/132 133 | https://developer.wordpress.org/cli/commands/ 134 | 135 | -------------------------------------------------------------------------------- /cli/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM amd64/php:7.1-cli 2 | 3 | ENV WORDPRESS_CLI_VERSION 1.4.1 4 | 5 | # Install requirements for wp-cli support 6 | RUN apt-get update && \ 7 | apt-get install --no-install-recommends -yqq \ 8 | sudo \ 9 | less \ 10 | mysql-client \ 11 | libjpeg-dev \ 12 | libpng-dev 13 | 14 | RUN docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr && \ 15 | docker-php-ext-install gd mysqli opcache 16 | 17 | # set recommended PHP.ini settings 18 | # see https://secure.php.net/manual/en/opcache.installation.php 19 | RUN { \ 20 | echo 'opcache.memory_consumption=128'; \ 21 | echo 'opcache.interned_strings_buffer=8'; \ 22 | echo 'opcache.max_accelerated_files=4000'; \ 23 | echo 'opcache.revalidate_freq=2'; \ 24 | echo 'opcache.fast_shutdown=1'; \ 25 | echo 'opcache.enable_cli=1'; \ 26 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 27 | 28 | # Install needed php extensions: ldap 29 | # 30 | RUN apt-get install libldap2-dev -y && \ 31 | docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \ 32 | docker-php-ext-install ldap 33 | 34 | RUN mkdir -p /var/www/html && \ 35 | chown -R www-data:www-data /var/www/html 36 | 37 | RUN curl -L https://github.com/wp-cli/wp-cli/releases/download/v${WORDPRESS_CLI_VERSION}/wp-cli-${WORDPRESS_CLI_VERSION}.phar \ 38 | -o /usr/local/bin/wp-cli.phar && \ 39 | chmod +x /usr/local/bin/wp-cli.phar && \ 40 | ln -s /usr/local/bin/wp-cli.phar /bin/wp && \ 41 | wp --allow-root --version 42 | 43 | # Cleanup 44 | RUN rm -rf /var/lib/apt/lists/* 45 | 46 | COPY docker-entrypoint.sh /docker-entrypoint.sh 47 | RUN chmod +x /docker-entrypoint.sh 48 | 49 | WORKDIR /var/www/html 50 | 51 | VOLUME /var/www/html 52 | 53 | USER www-data 54 | 55 | ENTRYPOINT [ "/docker-entrypoint.sh" ] 56 | CMD ["wp", "shell"] -------------------------------------------------------------------------------- /cli/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | # first arg is `-f` or `--some-option` 5 | if [ "${1#-}" != "$1" ]; then 6 | set -- wp "$@" 7 | fi 8 | 9 | # if our command is a valid wp-cli subcommand, let's invoke it through wp-cli instead 10 | # (this allows for "docker run wordpress:cli help", etc) 11 | if wp --path=/dev/null help "$1" > /dev/null 2>&1; then 12 | set -- wp "$@" 13 | fi 14 | 15 | exec "$@" -------------------------------------------------------------------------------- /conf/nginx.conf: -------------------------------------------------------------------------------- 1 | user nginx; 2 | worker_processes 1; 3 | 4 | error_log /var/log/nginx/error.log warn; 5 | pid /var/run/nginx.pid; 6 | 7 | 8 | events { 9 | worker_connections 1024; 10 | } 11 | 12 | http { 13 | # read more here http://tautt.com/best-nginx-configuration-for-security/ 14 | 15 | # don't send the nginx version number in error pages and Server header 16 | server_tokens off; 17 | 18 | # config to don't allow the browser to render the page inside an frame or iframe 19 | # and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking 20 | # if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri 21 | # https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options 22 | add_header X-Frame-Options SAMEORIGIN; 23 | 24 | # when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header, 25 | # to disable content-type sniffing on some browsers. 26 | # https://www.owasp.org/index.php/List_of_useful_HTTP_headers 27 | # currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx 28 | # http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx 29 | # 'soon' on Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=471020 30 | add_header X-Content-Type-Options nosniff; 31 | 32 | # This header enables the Cross-site scripting (XSS) filter built into most recent web browsers. 33 | # It's usually enabled by default anyway, so the role of this header is to re-enable the filter for 34 | # this particular website if it was disabled by the user. 35 | # https://www.owasp.org/index.php/List_of_useful_HTTP_headers 36 | add_header X-XSS-Protection "1; mode=block"; 37 | 38 | # with Content Security Policy (CSP) enabled(and a browser that supports it(http://caniuse.com/#feat=contentsecuritypolicy), 39 | # you can tell the browser that it can only download content from the domains you explicitly allow 40 | # http://www.html5rocks.com/en/tutorials/security/content-security-policy/ 41 | # https://www.owasp.org/index.php/Content_Security_Policy 42 | # I need to change our application code so we can increase security by disabling 'unsafe-inline' 'unsafe-eval' 43 | # directives for css and js(if you have inline css or js, you will need to keep it too). 44 | # more: http://www.html5rocks.com/en/tutorials/security/content-security-policy/#inline-code-considered-harmful 45 | add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://assets.zendesk.com https://connect.facebook.net; img-src 'self' https://ssl.google-analytics.com https://s-static.ak.facebook.com https://assets.zendesk.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://assets.zendesk.com; font-src 'self' https://themes.googleusercontent.com; frame-src https://assets.zendesk.com https://www.facebook.com https://s-static.ak.facebook.com https://tautt.zendesk.com; object-src 'none'"; 46 | 47 | include mime.types; 48 | default_type application/octet-stream; 49 | sendfile on; 50 | keepalive_timeout 65; 51 | 52 | gzip on; 53 | gzip_disable "msie6"; 54 | gzip_vary on; 55 | gzip_proxied any; 56 | gzip_comp_level 6; 57 | gzip_buffers 16 8k; 58 | gzip_http_version 1.1; 59 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascr ipt; 60 | 61 | 62 | server { 63 | listen 80; ## listen for ipv4; this line is default and implied 64 | listen [::]:80 default ipv6only=on; ## listen for ipv6 65 | 66 | charset UTF-8; 67 | root /var/www/html; 68 | index index.php index.html index.htm; 69 | 70 | server_name localhost; 71 | 72 | location / { 73 | try_files $uri $uri/ @memcached; 74 | } 75 | 76 | location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 77 | expires 24h; 78 | log_not_found off; 79 | } 80 | 81 | # redirect server error pages to the static page /50x.html 82 | # 83 | error_page 500 502 503 504 /50x.html; 84 | location = /50x.html { 85 | root /var/www/html; 86 | } 87 | 88 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 89 | # 90 | location ~ (\.php) { 91 | try_files $uri =404; 92 | fastcgi_index index.php; 93 | fastcgi_connect_timeout 10; 94 | fastcgi_send_timeout 180; 95 | fastcgi_read_timeout 180; 96 | fastcgi_buffer_size 512k; 97 | fastcgi_buffers 4 256k; 98 | fastcgi_busy_buffers_size 512k; 99 | fastcgi_temp_file_write_size 512k; 100 | fastcgi_intercept_errors on; 101 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 102 | fastcgi_keep_conn on; 103 | 104 | fastcgi_param QUERY_STRING $query_string; 105 | fastcgi_param REQUEST_METHOD $request_method; 106 | fastcgi_param CONTENT_TYPE $content_type; 107 | fastcgi_param CONTENT_LENGTH $content_length; 108 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 109 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 110 | fastcgi_param REQUEST_URI $request_uri; 111 | fastcgi_param DOCUMENT_URI $document_uri; 112 | fastcgi_param DOCUMENT_ROOT $document_root; 113 | fastcgi_param SERVER_PROTOCOL $server_protocol; 114 | fastcgi_param GATEWAY_INTERFACE CGI/1.1; 115 | fastcgi_param SERVER_SOFTWARE nginx; 116 | fastcgi_param REMOTE_ADDR $remote_addr; 117 | fastcgi_param REMOTE_PORT $remote_port; 118 | fastcgi_param SERVER_ADDR $server_addr; 119 | fastcgi_param SERVER_PORT $server_port; 120 | fastcgi_param SERVER_NAME $server_name; 121 | fastcgi_param PATH_INFO $fastcgi_path_info; 122 | fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; 123 | fastcgi_param REDIRECT_STATUS 200; 124 | 125 | # uncomment these for HTTPS usage 126 | #fastcgi_param HTTPS $https if_not_empty; 127 | #fastcgi_param SSL_PROTOCOL $ssl_protocol if_not_empty; 128 | #fastcgi_param SSL_CIPHER $ssl_cipher if_not_empty; 129 | #fastcgi_param SSL_SESSION_ID $ssl_session_id if_not_empty; 130 | #fastcgi_param SSL_CLIENT_VERIFY $ssl_client_verify if_not_empty; 131 | 132 | fastcgi_pass wordpress:9000; 133 | } 134 | 135 | # try to get result from memcached 136 | location @memcached { 137 | default_type text/html; 138 | set $memcached_key data-$scheme://$host$request_uri; 139 | set $memcached_request 1; 140 | 141 | # exceptions 142 | # avoid cache serve of POST requests 143 | if ($request_method = POST ) { 144 | set $memcached_request 0; 145 | } 146 | 147 | # avoid cache serve of wp-admin-like pages, starting with "wp-" 148 | if ( $uri ~ "/wp-" ) { 149 | set $memcached_request 0; 150 | } 151 | 152 | # avoid cache serve of any URL with query strings 153 | if ( $args ) { 154 | set $memcached_request 0; 155 | } 156 | 157 | if ($http_cookie ~* "comment_author_|wordpressuser_|wp-postpass_|wordpress_logged_in_" ) { 158 | set $memcached_request 0; 159 | } 160 | 161 | 162 | if ( $memcached_request = 1) { 163 | add_header X-Cache-Engine "WP-FFPC with memcache via nginx"; 164 | memcached_pass memcached-servers; 165 | error_page 404 = @rewrites; 166 | } 167 | 168 | if ( $memcached_request = 0) { 169 | rewrite ^ /index.php last; 170 | } 171 | } 172 | 173 | location @rewrites { 174 | add_header X-Cache-Engine "No cache"; 175 | rewrite ^ /index.php last; 176 | } 177 | 178 | } 179 | 180 | upstream memcached-servers { 181 | server wp-memcached:11211; 182 | } 183 | } 184 | -------------------------------------------------------------------------------- /docker-compose.php5-fpm.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | volumes: 3 | wordpress-db: 4 | wordpress-data: 5 | 6 | services: 7 | mariadb: 8 | image: amd64/mariadb:10.2 9 | environment: 10 | MYSQL_DATABASE: wordpress 11 | MYSQL_PASSWORD: Chang3M3 12 | MYSQL_ROOT_PASSWORD: Change3M34ls0 13 | MYSQL_USER: wordpress 14 | volumes: 15 | - wordpress-db:/var/lib/mysql 16 | 17 | memcached: 18 | image: amd64/memcached:1.5 19 | 20 | nginx: 21 | build: nginx/ 22 | image: fjudith/wordpress:nginx 23 | ports: 24 | - 31716:443/tcp 25 | - 31715:80/tcp 26 | links: 27 | - memcached:memcached 28 | - wordpress:wordpress 29 | volumes: 30 | - wordpress-data:/var/www/html:rw 31 | 32 | wordpress: 33 | build: php5-fpm/ 34 | image: fjudith/wordpress:php5-fpm 35 | environment: 36 | WORDPRESS_DB_HOST: mariadb 37 | WORDPRESS_DB_NAME: wordpress 38 | WORDPRESS_DB_USER: wordpress 39 | WORDPRESS_DB_PASSWORD: Chang3M3 40 | links: 41 | - memcached:memcached 42 | - mariadb:mysql 43 | volumes: 44 | - wordpress-data:/var/www/html 45 | 46 | cli: 47 | build: cli/ 48 | image: fjudith/wordpress:cli 49 | stdin_open: true 50 | tty: true 51 | depends_on: 52 | - mariadb 53 | - wordpress 54 | links: 55 | - mariadb:mysql 56 | volumes: 57 | - wordpress-data:/var/www/html -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | volumes: 3 | wordpress-db: 4 | wordpress-data: 5 | 6 | services: 7 | mariadb: 8 | image: amd64/mariadb:10.2 9 | environment: 10 | MYSQL_DATABASE: wordpress 11 | MYSQL_PASSWORD: Chang3M3 12 | MYSQL_ROOT_PASSWORD: Change3M34ls0 13 | MYSQL_USER: wordpress 14 | volumes: 15 | - wordpress-db:/var/lib/mysql 16 | 17 | memcached: 18 | image: amd64/memcached:1.5 19 | 20 | nginx: 21 | build: nginx/ 22 | image: fjudith/wordpress:nginx 23 | ports: 24 | - 32716:443/tcp 25 | - 32715:80/tcp 26 | links: 27 | - memcached:memcached 28 | - wordpress:wordpress 29 | volumes: 30 | - wordpress-data:/var/www/html:rw 31 | 32 | wordpress: 33 | build: php7-fpm/ 34 | image: fjudith/wordpress:php7-fpm 35 | environment: 36 | WORDPRESS_DB_HOST: mariadb 37 | WORDPRESS_DB_NAME: wordpress 38 | WORDPRESS_DB_USER: wordpress 39 | WORDPRESS_DB_PASSWORD: Chang3M3 40 | links: 41 | - memcached:memcached 42 | - mariadb:mysql 43 | volumes: 44 | - wordpress-data:/var/www/html 45 | 46 | cli: 47 | build: cli/ 48 | image: fjudith/wordpress:cli 49 | stdin_open: true 50 | tty: true 51 | depends_on: 52 | - mariadb 53 | - wordpress 54 | links: 55 | - mariadb:mysql 56 | volumes: 57 | - wordpress-data:/var/www/html -------------------------------------------------------------------------------- /kubernetes/k8swordpress.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | while [ $# -gt 0 ]; do 4 | 5 | if [[ $1 == *"--"* ]]; then 6 | v="${1/--/}" 7 | declare $v="$2" 8 | fi 9 | 10 | shift 11 | done 12 | 13 | # Create 14 | if [ -z create ] ; then 15 | kubectl create namespace wordpress 16 | 17 | tr --delete '\n' .strippedpassword.txt && mv .strippedpassword.txt password.txt 18 | kubectl apply -f ./local-volumes.yaml 19 | kubectl create secret -n wordpress generic wp-mysql-pass --from-file=password.txt 20 | kubectl apply -n wordpress -f ./mysql-deployment.yaml 21 | kubectl apply -n wordpress -f ./wordpress-deployment.yaml 22 | 23 | kubectl get svc nginx -n wordpress 24 | elif [ -v create ] && [ "$create" == "conduit" ]; then 25 | kubectl create namespace wordpress 26 | 27 | tr --delete '\n' .strippedpassword.txt && mv .strippedpassword.txt password.txt 28 | kubectl apply -f ./local-volumes.yaml 29 | kubectl create secret -n wordpress generic wp-mysql-pass --from-file=password.txt 30 | cat ./mysql-deployment.yaml | conduit inject --skip-inbound-ports=3306 - | kubectl apply -n wordpress -f - 31 | cat ./wordpress-deployment.yaml | conduit inject --skip-outbound-ports=3306,9000,11211 --skip-inbound-ports=3306,9000,11211 - | kubectl apply -n wordpress -f - 32 | 33 | kubectl get svc nginx -n wordpress -o jsonpath="{.status.loadBalancer.ingress[0].*}" 34 | 35 | kubectl get svc nginx -n wordpress 36 | elif [ -v create ] && [ "$create" == "istio" ]; then 37 | kubectl create namespace wordpress 38 | kubectl label namespace wordpress istio-injection=enabled 39 | 40 | tr --delete '\n' .strippedpassword.txt && mv .strippedpassword.txt password.txt 41 | kubectl apply -f ./local-volumes.yaml 42 | kubectl create secret -n wordpress generic wp-mysql-pass --from-file=password.txt 43 | kubectl apply -n wordpress -f ./mysql-deployment.yaml 44 | kubectl apply -n wordpress -f ./wordpress-deployment.yaml 45 | kubectl apply -n wordpress -f ./wordpress-ingress.yaml 46 | 47 | export GATEWAY_URL=$(kubectl get po -l istio=ingress -n istio-system -o 'jsonpath={.items[0].status.hostIP}'):$(kubectl get svc istio-ingress -n istio-system -o 'jsonpath={.spec.ports[0].nodePort}') 48 | 49 | printf "Istio Gateway: $GATEWAY_URL" 50 | fi 51 | 52 | 53 | # Delete 54 | if [ -z delete ] || [ "$delete" == "conduit" ]; then 55 | kubectl delete -f ./local-volumes.yaml 56 | kubectl delete secret -n wordpress wp-mysql-pass 57 | kubectl delete -n wordpress -f ./mysql-deployment.yaml 58 | kubectl delete -n wordpress -f ./wordpress-deployment.yaml 59 | 60 | kubectl delete namespace wordpress 61 | fi 62 | 63 | if [ -v delete ] && [ "$delete" == "istio" ]; then 64 | kubectl delete -f ./local-volumes.yaml 65 | kubectl delete secret -n wordpress wp-mysql-pass 66 | kubectl delete -n wordpress -f ./mysql-deployment.yaml 67 | kubectl delete -n wordpress -f ./wordpress-deployment.yaml 68 | kubectl delete -n wordpress -f ./wordpress-ingress.yaml 69 | 70 | kubectl delete namespace wordpress 71 | fi -------------------------------------------------------------------------------- /kubernetes/local-volumes.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolume 3 | metadata: 4 | name: local-pv-1 5 | labels: 6 | type: local 7 | spec: 8 | capacity: 9 | storage: 2Gi 10 | accessModes: 11 | - ReadWriteOnce 12 | hostPath: 13 | path: /tmp/data/pv-1 14 | --- 15 | apiVersion: v1 16 | kind: PersistentVolume 17 | metadata: 18 | name: local-pv-2 19 | labels: 20 | type: local 21 | spec: 22 | capacity: 23 | storage: 2Gi 24 | accessModes: 25 | - ReadWriteMany 26 | hostPath: 27 | path: /tmp/data/pv-2 -------------------------------------------------------------------------------- /kubernetes/mysql-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql 5 | labels: 6 | app: wordpress 7 | spec: 8 | ports: 9 | - port: 3306 10 | selector: 11 | app: wordpress 12 | tier: mysql 13 | clusterIP: None 14 | --- 15 | apiVersion: v1 16 | kind: PersistentVolumeClaim 17 | metadata: 18 | name: mysql-pv-claim 19 | labels: 20 | app: wordpress 21 | spec: 22 | accessModes: 23 | - ReadWriteOnce 24 | resources: 25 | requests: 26 | storage: 2Gi 27 | --- 28 | apiVersion: extensions/v1beta1 29 | kind: Deployment 30 | metadata: 31 | name: mysql 32 | labels: 33 | app: wordpress 34 | spec: 35 | strategy: 36 | type: Recreate 37 | template: 38 | metadata: 39 | labels: 40 | app: wordpress 41 | tier: mysql 42 | spec: 43 | containers: 44 | - image: mysql:5.6 45 | name: mysql 46 | env: 47 | # $ kubectl create secret generic mysql-pass --from-file=password.txt 48 | # make sure password.txt does not have a trailing newline 49 | - name: MYSQL_DATABASE 50 | value: wordpress 51 | - name: MYSQL_USER 52 | value: wordpress 53 | - name: MYSQL_PASSWORD 54 | valueFrom: 55 | secretKeyRef: 56 | name: wp-mysql-pass 57 | key: password.txt 58 | - name: MYSQL_ROOT_PASSWORD 59 | valueFrom: 60 | secretKeyRef: 61 | name: wp-mysql-pass 62 | key: password.txt 63 | ports: 64 | - containerPort: 3306 65 | name: mysql 66 | volumeMounts: 67 | - name: mysql-persistent-storage 68 | mountPath: /var/lib/mysql 69 | volumes: 70 | - name: mysql-persistent-storage 71 | persistentVolumeClaim: 72 | claimName: mysql-pv-claim -------------------------------------------------------------------------------- /kubernetes/password.txt: -------------------------------------------------------------------------------- 1 | V3ry1ns3cur3P4ssw0rd -------------------------------------------------------------------------------- /kubernetes/wordpress-deployment.yaml: -------------------------------------------------------------------------------- 1 | ########################################################################## 2 | # Wordpress PHP-FPM 3 | ########################################################################## 4 | apiVersion: v1 5 | kind: Service 6 | metadata: 7 | name: wordpress 8 | labels: 9 | app: wordpress 10 | spec: 11 | ports: 12 | - name: fpm-tcp 13 | port: 9000 14 | targetPort: 9000 15 | protocol: TCP 16 | selector: 17 | app: wordpress 18 | tier: engine 19 | type: ClusterIP 20 | --- 21 | apiVersion: v1 22 | kind: PersistentVolumeClaim 23 | metadata: 24 | name: wp-pv-claim 25 | labels: 26 | app: wordpress 27 | spec: 28 | accessModes: 29 | - ReadWriteMany 30 | resources: 31 | requests: 32 | storage: 2Gi 33 | --- 34 | apiVersion: apps/v1 35 | kind: Deployment 36 | metadata: 37 | name: wordpress 38 | labels: 39 | app: wordpress 40 | spec: 41 | selector: 42 | matchLabels: 43 | app: wordpress 44 | strategy: 45 | type: Recreate 46 | template: 47 | metadata: 48 | labels: 49 | app: wordpress 50 | tier: engine 51 | spec: 52 | containers: 53 | - image: fjudith/wordpress:php7-fpm 54 | name: wordpress 55 | env: 56 | - name: WORDPRESS_DB_HOST 57 | value: mysql 58 | - name: WORDPRESS_DB_NAME 59 | value: wordpress 60 | - name: WORDPRESS_DB_USER 61 | value: wordpress 62 | - name: WORDPRESS_DB_PASSWORD 63 | valueFrom: 64 | secretKeyRef: 65 | name: wp-mysql-pass 66 | key: password.txt 67 | ports: 68 | - containerPort: 9000 69 | name: fpm-tcp 70 | protocol: TCP 71 | livenessProbe: 72 | tcpSocket: 73 | port: 9000 74 | initialDelaySeconds: 30 75 | timeoutSeconds: 30 76 | volumeMounts: 77 | - name: wordpress-persistent-storage 78 | mountPath: /var/www/html 79 | volumes: 80 | - name: wordpress-persistent-storage 81 | persistentVolumeClaim: 82 | claimName: wp-pv-claim 83 | --- 84 | ########################################################################## 85 | # Deployment (memcached) 86 | ########################################################################## 87 | apiVersion: v1 88 | kind: Service 89 | metadata: 90 | name: memcached 91 | labels: 92 | app: wordpress 93 | spec: 94 | ports: 95 | - name: memcached-tcp 96 | port: 11211 97 | targetPort: 11211 98 | protocol: TCP 99 | - name: memcached-udp 100 | port: 11211 101 | targetPort: 11211 102 | protocol: UDP 103 | selector: 104 | app: wordpress 105 | tier: caching 106 | type: ClusterIP 107 | --- 108 | apiVersion: apps/v1 109 | kind: Deployment 110 | metadata: 111 | name: memcached 112 | labels: 113 | app: wordpress 114 | spec: 115 | selector: 116 | matchLabels: 117 | app: wordpress 118 | strategy: 119 | type: Recreate 120 | template: 121 | metadata: 122 | labels: 123 | app: wordpress 124 | tier: caching 125 | spec: 126 | containers: 127 | - image: amd64/memcached:1.5 128 | name: memcached 129 | ports: 130 | - containerPort: 11211 131 | name: memcached-tcp 132 | protocol: TCP 133 | - containerPort: 11211 134 | name: memcached-udp 135 | protocol: UDP 136 | livenessProbe: 137 | tcpSocket: 138 | port: 11211 139 | initialDelaySeconds: 30 140 | timeoutSeconds: 30 141 | --- 142 | ########################################################################## 143 | # Nginx 144 | ########################################################################## 145 | apiVersion: v1 146 | kind: Service 147 | metadata: 148 | name: nginx 149 | labels: 150 | app: wordpress 151 | spec: 152 | type: LoadBalancer 153 | ports: 154 | - name: http 155 | port: 80 156 | protocol: TCP 157 | - name: https 158 | port: 443 159 | protocol: TCP 160 | selector: 161 | app: wordpress 162 | tier: frontend 163 | --- 164 | apiVersion: apps/v1 165 | kind: Deployment 166 | metadata: 167 | name: nginx 168 | labels: 169 | app: wordpress 170 | spec: 171 | selector: 172 | matchLabels: 173 | app: wordpress 174 | strategy: 175 | type: Recreate 176 | template: 177 | metadata: 178 | labels: 179 | app: wordpress 180 | tier: frontend 181 | spec: 182 | containers: 183 | - image: fjudith/wordpress:nginx 184 | name: nginx 185 | ports: 186 | - containerPort: 80 187 | name: http 188 | - containerPort: 443 189 | name: https 190 | volumeMounts: 191 | - name: wordpress-persistent-storage 192 | mountPath: /var/www/html 193 | volumes: 194 | - name: wordpress-persistent-storage 195 | persistentVolumeClaim: 196 | claimName: wp-pv-claim 197 | --- -------------------------------------------------------------------------------- /kubernetes/wordpress-ingress.yaml: -------------------------------------------------------------------------------- 1 | ########################################################################## 2 | # Ingress resource (gateway) 3 | ########################################################################## 4 | apiVersion: extensions/v1beta1 5 | kind: Ingress 6 | metadata: 7 | name: gateway 8 | annotations: 9 | kubernetes.io/ingress.class: "istio" 10 | spec: 11 | rules: 12 | - http: 13 | paths: 14 | - path: / 15 | backend: 16 | serviceName: nginx 17 | servicePort: 80 18 | - path: /wp-.* 19 | backend: 20 | serviceName: nginx 21 | servicePort: 80 22 | --- -------------------------------------------------------------------------------- /nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:stable 2 | 3 | LABEL maintainer="Florian JUDITH " 4 | 5 | RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \ 6 | openssl \ 7 | certbot \ 8 | netcat 9 | 10 | RUN apt-get clean && rm -rf /var/lib/apt/lists/* 11 | 12 | RUN rm -f /etc/nginx/conf.d/default.conf 13 | RUN rm -f /etc/nginx/conf.d/example_ssl.conf 14 | 15 | COPY wordpress.conf /etc/nginx/conf.d/wordpress.conf 16 | COPY nginx.conf /etc/nginx/nginx.conf 17 | COPY docker-entrypoint.sh / 18 | RUN chmod +x docker-entrypoint.sh 19 | 20 | EXPOSE 80 443 21 | 22 | ENTRYPOINT ["/docker-entrypoint.sh"] 23 | CMD ["nginx"] -------------------------------------------------------------------------------- /nginx/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #set -e 3 | 4 | LETS_ENCRYPT_ENABLED=${LETS_ENCRYPT_ENABLED:-false} 5 | PUBLIC_DNS=${PUBLIC_DNS:-'wordpress.example.com'} 6 | ORGANISATION_UNIT=${ORGANIZATION_UNIT:-'Cloud Native Application'} 7 | ORGANISATION=${ORGANISATION:-'example inc'} 8 | CITY=${CITY:-'Paris'} 9 | STATE=${STATE:-'Paris'} 10 | COUNTRY_CODE=${COUNTRY:-'FR'} 11 | KEYSTORE_PASS=${KEYSTORE_PASS:-'V3ry1nS3cur3P4ssw0rd'} 12 | KEY_PASS=${KEYSTORE_PASS:-$KEYSTORE_PASS} 13 | 14 | SSL_CERT_PATH=${SSL_CERT_PATH:-'/etc/nginx/ssl'} 15 | mkdir -p ${SSL_CERT_PATH} 16 | 17 | if ! [ -f $SSL_CERT_PATH/nginx.crt ] && [ "$LETS_ENCRYPT_ENABLED" == "true" ]; then 18 | echo "Generating Let's Encrypt certificate" 19 | 20 | pushd ${SSL_CERT_PATH} 21 | 22 | openssl req -subj "/CN=${PUBLIC_DNS}/OU=${ORGANISATION_UNIT}/O=${ORGANISATION}/L=${CITY}/ST=${STATE}/C=${COUNTRY_CODE}" -newkey rsa:2048 -nodes -keyout $SSL_CERT_PATH/nginx.key -out $SSL_CERT_PATH/nginx.csr 23 | certbot certonly --csr $SSL_CERT_PATH/nginx.csr --standalone --register-unsafely-without-email --agree-tos 24 | mv 0001_chain.pem nginx.crt 25 | popd 26 | fi 27 | 28 | if ! [ -f $SSL_CERT_PATH/nginx.crt ] && [ "$LETS_ENCRYPT_ENABLED" == "false" ]; then 29 | echo "Generating Self-Signed certificate" 30 | 31 | openssl req -subj "/CN=${PUBLIC_DNS}/OU=${ORGANISATION_UNIT}/O=${ORGANISATION}/L=${CITY}/ST=${STATE}/C=${COUNTRY_CODE}" -new -newkey rsa:2048 -sha256 -days 3650 -nodes -x509 -keyout $SSL_CERT_PATH/nginx.key -out $SSL_CERT_PATH/nginx.crt 32 | fi 33 | 34 | exec "$@" -------------------------------------------------------------------------------- /nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | daemon off; 2 | user nginx; 3 | worker_processes 2; 4 | 5 | error_log /var/log/nginx/error.log warn; 6 | pid /var/run/nginx.pid; 7 | 8 | events { 9 | worker_connections 1024; 10 | use epoll; 11 | accept_mutex off; 12 | } 13 | 14 | http { 15 | include /etc/nginx/mime.types; 16 | proxy_set_header X-Real-IP $remote_addr; 17 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 18 | 19 | default_type application/octet-stream; 20 | 21 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 22 | '$status $body_bytes_sent "$http_referer" ' 23 | '"$http_user_agent" "$http_x_forwarded_for"'; 24 | 25 | access_log /var/log/nginx/access.log main; 26 | 27 | sendfile on; 28 | #tcp_nopush on; 29 | 30 | keepalive_timeout 65; 31 | 32 | client_max_body_size 0; 33 | client_body_buffer_size 128k; 34 | 35 | gzip on; 36 | gzip_http_version 1.0; 37 | gzip_comp_level 6; 38 | gzip_min_length 0; 39 | gzip_buffers 16 8k; 40 | gzip_proxied any; 41 | gzip_types text/plain text/css text/xml text/javascript application/xml application/xml+rss application/javascript application/json; 42 | gzip_disable "MSIE [1-6]\."; 43 | gzip_vary on; 44 | 45 | include /etc/nginx/conf.d/*.conf; 46 | } -------------------------------------------------------------------------------- /nginx/wordpress.conf: -------------------------------------------------------------------------------- 1 | upstream memcached-servers { 2 | server memcached:11211; 3 | } 4 | 5 | server { 6 | listen 80; ## listen for ipv4; this line is default and implied 7 | listen [::]:80 default ipv6only=on; ## listen for ipv6 8 | listen 443 ssl http2; 9 | listen [::]:443 ipv6only=on ssl http2; 10 | server_name wordpress.example.com; 11 | 12 | keepalive_timeout 5 5; 13 | proxy_buffering off; 14 | 15 | # Enable SSL 16 | #ssl on; 17 | ssl_certificate /etc/nginx/ssl/nginx.crt; 18 | ssl_certificate_key /etc/nginx/ssl/nginx.key; 19 | ssl_session_timeout 5m; 20 | 21 | # Strong SSL Security 22 | # https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html 23 | ssl_protocols TLSv1.1 TLSv1.2; 24 | ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; 25 | ssl_prefer_server_ciphers on; 26 | ssl_session_cache shared:SSL:10m; 27 | 28 | # allow large uploads 29 | client_max_body_size 4G; 30 | 31 | # required to avoid HTTP 411: see Issue #1486 (https://github.com/docker/docker/issues/1486) 32 | chunked_transfer_encoding on; 33 | 34 | charset UTF-8; 35 | root /var/www/html; 36 | index index.php index.html index.htm; 37 | 38 | server_name localhost; 39 | 40 | location / { 41 | try_files $uri $uri/ @memcached; 42 | proxy_http_version 1.1; 43 | } 44 | 45 | location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 46 | expires 24h; 47 | log_not_found off; 48 | } 49 | 50 | # redirect server error pages to the static page /50x.html 51 | # 52 | error_page 500 502 503 504 /50x.html; 53 | location = /50x.html { 54 | root /var/www/html; 55 | } 56 | 57 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 58 | # 59 | location ~ (\.php) { 60 | try_files $uri =404; 61 | fastcgi_index index.php; 62 | fastcgi_connect_timeout 10; 63 | fastcgi_send_timeout 180; 64 | fastcgi_read_timeout 180; 65 | fastcgi_buffer_size 512k; 66 | fastcgi_buffers 4 256k; 67 | fastcgi_busy_buffers_size 512k; 68 | fastcgi_temp_file_write_size 512k; 69 | fastcgi_intercept_errors on; 70 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 71 | fastcgi_keep_conn on; 72 | 73 | fastcgi_param QUERY_STRING $query_string; 74 | fastcgi_param REQUEST_METHOD $request_method; 75 | fastcgi_param CONTENT_TYPE $content_type; 76 | fastcgi_param CONTENT_LENGTH $content_length; 77 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 78 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 79 | fastcgi_param REQUEST_URI $request_uri; 80 | fastcgi_param DOCUMENT_URI $document_uri; 81 | fastcgi_param DOCUMENT_ROOT $document_root; 82 | fastcgi_param SERVER_PROTOCOL $server_protocol; 83 | fastcgi_param GATEWAY_INTERFACE CGI/1.1; 84 | fastcgi_param SERVER_SOFTWARE nginx; 85 | fastcgi_param REMOTE_ADDR $remote_addr; 86 | fastcgi_param REMOTE_PORT $remote_port; 87 | fastcgi_param SERVER_ADDR $server_addr; 88 | fastcgi_param SERVER_PORT $server_port; 89 | fastcgi_param SERVER_NAME $server_name; 90 | fastcgi_param PATH_INFO $fastcgi_path_info; 91 | fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; 92 | fastcgi_param REDIRECT_STATUS 200; 93 | 94 | # uncomment these for HTTPS usage 95 | #fastcgi_param HTTPS $https if_not_empty; 96 | #fastcgi_param SSL_PROTOCOL $ssl_protocol if_not_empty; 97 | #fastcgi_param SSL_CIPHER $ssl_cipher if_not_empty; 98 | #fastcgi_param SSL_SESSION_ID $ssl_session_id if_not_empty; 99 | #fastcgi_param SSL_CLIENT_VERIFY $ssl_client_verify if_not_empty; 100 | 101 | fastcgi_pass wordpress:9000; 102 | } 103 | 104 | # try to get result from memcached 105 | location @memcached { 106 | default_type text/html; 107 | set $memcached_key data-$scheme://$host$request_uri; 108 | set $memcached_request 1; 109 | 110 | # exceptions 111 | # avoid cache serve of POST requests 112 | if ($request_method = POST ) { 113 | set $memcached_request 0; 114 | } 115 | 116 | # avoid cache serve of wp-admin-like pages, starting with "wp-" 117 | if ( $uri ~ "/wp-" ) { 118 | set $memcached_request 0; 119 | } 120 | 121 | # avoid cache serve of any URL with query strings 122 | if ( $args ) { 123 | set $memcached_request 0; 124 | } 125 | 126 | if ($http_cookie ~* "comment_author_|wordpressuser_|wp-postpass_|wordpress_logged_in_" ) { 127 | set $memcached_request 0; 128 | } 129 | 130 | 131 | if ( $memcached_request = 1) { 132 | add_header X-Cache-Engine "WP-FFPC with memcache via nginx"; 133 | memcached_pass memcached-servers; 134 | error_page 404 = @rewrites; 135 | } 136 | 137 | if ( $memcached_request = 0) { 138 | rewrite ^ /index.php last; 139 | } 140 | } 141 | 142 | location @rewrites { 143 | add_header X-Cache-Engine "No cache"; 144 | rewrite ^ /index.php last; 145 | } 146 | 147 | } -------------------------------------------------------------------------------- /php5-fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM wordpress:5.1.1-php5.6-fpm 2 | 3 | LABEL maintainer='Florian JUDITH ' 4 | 5 | RUN apt-get update 6 | RUN apt-get install --no-install-recommends -y tidy csstidy nano netcat 7 | 8 | RUN mkdir -p /usr/src/php/ext 9 | 10 | # Install needed php extensions: memcached 11 | # 12 | RUN apt-get install --no-install-recommends -y libmemcached-dev && \ 13 | curl -o memcached.tgz -SL http://pecl.php.net/get/memcached-2.2.0.tgz && \ 14 | tar -xf memcached.tgz -C /usr/src/php/ext/ && \ 15 | echo extension=memcached.so >> /usr/local/etc/php/conf.d/memcached.ini && \ 16 | rm memcached.tgz && \ 17 | mv /usr/src/php/ext/memcached-2.2.0 /usr/src/php/ext/memcached 18 | 19 | # set recommended PHP.ini settings 20 | # see https://secure.php.net/manual/en/opcache.installation.php 21 | RUN { \ 22 | echo 'opcache.memory_consumption=128'; \ 23 | echo 'opcache.interned_strings_buffer=8'; \ 24 | echo 'opcache.max_accelerated_files=4000'; \ 25 | echo 'opcache.revalidate_freq=2'; \ 26 | echo 'opcache.fast_shutdown=1'; \ 27 | echo 'opcache.enable_cli=1'; \ 28 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 29 | 30 | # Install needed php extensions: memcache 31 | # 32 | RUN curl -o memcache.tgz -SL http://pecl.php.net/get/memcache-3.0.8.tgz && \ 33 | tar -xf memcache.tgz -C /usr/src/php/ext/ && \ 34 | rm memcache.tgz && \ 35 | mv /usr/src/php/ext/memcache-3.0.8 /usr/src/php/ext/memcache 36 | 37 | RUN apt-get install -y --no-install-recommends libz-dev && \ 38 | curl -o zip.tgz -SL http://pecl.php.net/get/zip-1.15.1.tgz && \ 39 | tar -xf zip.tgz -C /usr/src/php/ext/ && \ 40 | rm zip.tgz && \ 41 | mv /usr/src/php/ext/zip-1.15.1 /usr/src/php/ext/zip 42 | 43 | RUN docker-php-ext-install memcached 44 | RUN docker-php-ext-install memcache 45 | RUN docker-php-ext-install zip 46 | 47 | # Install needed php extensions: ldap 48 | # 49 | RUN apt-get install --no-install-recommends -y libldap2-dev && \ 50 | docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \ 51 | docker-php-ext-install ldap 52 | 53 | # Cleanup 54 | RUN rm -rf /var/lib/apt/lists/* 55 | 56 | 57 | # ENTRYPOINT resets CMD 58 | ENTRYPOINT ["docker-entrypoint.sh"] 59 | CMD ["php-fpm"] -------------------------------------------------------------------------------- /php7-fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM wordpress:5.1.1-php7.1-fpm 2 | 3 | LABEL maintainer='Florian JUDITH ' 4 | 5 | RUN apt-get update 6 | RUN apt-get install --no-install-recommends -y tidy csstidy nano netcat 7 | 8 | RUN mkdir -p /usr/src/php/ext 9 | 10 | # Install needed php extensions: memcached 11 | # 12 | RUN apt-get install -y libpq-dev libmemcached-dev && \ 13 | curl -o memcached.tgz -SL http://pecl.php.net/get/memcached-3.0.3.tgz && \ 14 | tar -xf memcached.tgz -C /usr/src/php/ext/ && \ 15 | echo extension=memcached.so >> /usr/local/etc/php/conf.d/memcached.ini && \ 16 | rm memcached.tgz && \ 17 | mv /usr/src/php/ext/memcached-3.0.3 /usr/src/php/ext/memcached 18 | 19 | # set recommended PHP.ini settings 20 | # see https://secure.php.net/manual/en/opcache.installation.php 21 | RUN { \ 22 | echo 'opcache.memory_consumption=128'; \ 23 | echo 'opcache.interned_strings_buffer=8'; \ 24 | echo 'opcache.max_accelerated_files=4000'; \ 25 | echo 'opcache.revalidate_freq=2'; \ 26 | echo 'opcache.fast_shutdown=1'; \ 27 | echo 'opcache.enable_cli=1'; \ 28 | } > /usr/local/etc/php/conf.d/opcache-recommended.ini 29 | 30 | 31 | # Install needed php extensions: memcache 32 | # 33 | RUN apt-get install --no-install-recommends -y unzip libssl-dev libpcre3 libpcre3-dev && \ 34 | cd /usr/src/php/ext/ && \ 35 | curl -sSL -o php7.zip https://github.com/websupport-sk/pecl-memcache/archive/NON_BLOCKING_IO_php7.zip && \ 36 | unzip php7.zip && \ 37 | mv pecl-memcache-NON_BLOCKING_IO_php7 memcache && \ 38 | docker-php-ext-configure memcache --with-php-config=/usr/local/bin/php-config && \ 39 | docker-php-ext-install memcache && \ 40 | echo "extension=memcache.so" > /usr/local/etc/php/conf.d/ext-memcache.ini && \ 41 | rm -rf /tmp/pecl-memcache-php7 php7.zip 42 | 43 | 44 | # Install needed php extensions: zip 45 | # 46 | RUN apt-get install -y libz-dev && \ 47 | curl -o zip.tgz -SL http://pecl.php.net/get/zip-1.15.1.tgz && \ 48 | tar -xf zip.tgz -C /usr/src/php/ext/ && \ 49 | rm zip.tgz && \ 50 | mv /usr/src/php/ext/zip-1.15.1 /usr/src/php/ext/zip 51 | 52 | RUN docker-php-ext-install memcached 53 | RUN docker-php-ext-install memcache 54 | RUN docker-php-ext-install zip 55 | 56 | 57 | # Install needed php extensions: ldap 58 | # 59 | RUN apt-get install libldap2-dev -y && \ 60 | docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \ 61 | docker-php-ext-install ldap 62 | 63 | # Install needed wordpress extensions: WP-FFPC 64 | # 65 | RUN cd /usr/src/wordpress/wp-content/plugins && \ 66 | curl -o wp-ffpc.zip -L https://downloads.wordpress.org/plugin/wp-ffpc.zip && \ 67 | unzip -o wp-ffpc.zip && \ 68 | chown -R www-data:www-data wp-ffpc && \ 69 | rm -f wp-ffpc.zip 70 | 71 | # Enable Wordpress Caching 72 | RUN cd /usr/src/wordpress && ls -l && \ 73 | sed -ri -e "s#(<\?php)#\\1\ndefine('WP_CACHE', 'true');#g" wp-config-sample.php 74 | 75 | # Install needed wordpress extensions: Simple-Ldap-Login 76 | # 77 | RUN cd /usr/src/wordpress/wp-content/plugins && \ 78 | curl -o simple-ldap-login.zip -L https://downloads.wordpress.org/plugin/simple-ldap-login.1.6.0.zip && \ 79 | unzip -o simple-ldap-login.zip && \ 80 | chown -R www-data:www-data simple-ldap-login && \ 81 | rm -f simple-ldap-login.zip 82 | 83 | # Cleanup 84 | RUN rm -rf /var/lib/apt/lists/* 85 | 86 | 87 | # ENTRYPOINT resets CMD 88 | ENTRYPOINT ["docker-entrypoint.sh"] 89 | CMD ["php-fpm"] -------------------------------------------------------------------------------- /wordpress_architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fjudith/docker-wordpress/92fb686bec8b8988e118a09649c3d9e7f2ca50b2/wordpress_architecture.png --------------------------------------------------------------------------------