├── .dockerignore ├── .env ├── .github ├── ISSUE_TEMPLATE │ ├── Bug_report.md │ ├── Custom.md │ └── Feature_request.md ├── issue_template.md └── workflows │ └── workflow.yml ├── .gitignore ├── LICENSE.md ├── Makefile ├── README.md ├── compose.override.yml ├── compose.yml ├── docker.mk ├── tests ├── 10 │ ├── .env │ ├── compose.yml │ ├── run.sh │ ├── search_api.server.solr.yml │ ├── test.settings.php │ ├── tests.sh │ └── varnish-purger.yml ├── 11 │ ├── .env │ ├── compose.yml │ ├── run.sh │ ├── search_api.server.solr.yml │ ├── test.settings.php │ ├── tests.sh │ └── varnish-purger.yml └── cms │ ├── .env │ ├── compose.yml │ ├── run.sh │ ├── search_api.server.solr.yml │ ├── test.settings.php │ ├── tests.sh │ └── varnish-purger.yml └── traefik.yml /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | ### Documentation available at https://wodby.com/docs/stacks/drupal/local 2 | ### Changelog can be found at https://github.com/wodby/docker4drupal/releases 3 | ### Images tags format explained at https://github.com/wodby/docker4drupal#images-tags 4 | 5 | ### PROJECT SETTINGS 6 | 7 | PROJECT_NAME=my_drupal11_project 8 | PROJECT_BASE_URL=drupal.docker.localhost 9 | PROJECT_PORT=8000 10 | 11 | DB_NAME=drupal 12 | DB_USER=drupal 13 | DB_PASSWORD=drupal 14 | DB_ROOT_PASSWORD=password 15 | DB_HOST=mariadb 16 | DB_PORT=3306 17 | DB_DRIVER=mysql 18 | 19 | ### --- MARIADB ---- 20 | 21 | MARIADB_TAG=11.4-3.32.0 22 | #MARIADB_TAG=10.11-3.32.0 23 | #MARIADB_TAG=10.6-3.32.0 24 | #MARIADB_TAG=10.5-3.32.0 25 | 26 | ### --- DRUPAL CMS ---- 27 | 28 | DRUPAL_CMS_TAG=1-0.3.8 29 | 30 | ### --- VANILLA DRUPAL ---- 31 | 32 | DRUPAL_TAG=11-4.81.12 33 | #DRUPAL_TAG=10-4.81.12 34 | 35 | ### --- PHP ---- 36 | 37 | # Linux (uid 1000 gid 1000) 38 | 39 | PHP_TAG=8.4-dev-4.66.7 40 | #PHP_TAG=8.3-dev-4.66.7 41 | #PHP_TAG=8.2-dev-4.66.7 42 | #PHP_TAG=8.1-dev-4.66.7 43 | 44 | # macOS (uid 501 gid 20) 45 | 46 | #PHP_TAG=8.4-dev-macos-4.66.7 47 | #PHP_TAG=8.3-dev-macos-4.66.7 48 | #PHP_TAG=8.2-dev-macos-4.66.7 49 | #PHP_TAG=8.1-dev-macos-4.66.7 50 | 51 | ### --- NGINX ---- 52 | 53 | NGINX_TAG=1.28-5.43.0 54 | #NGINX_TAG=1.27-5.43.0 55 | 56 | NGINX_VHOST_PRESET=drupal11 57 | #NGINX_VHOST_PRESET=drupal10 58 | 59 | ### --- SOLR --- 60 | 61 | SOLR_TAG=9-5.1.6 62 | 63 | ### --- OPENSEARCH --- 64 | 65 | OPENSEARCH_TAG=2 66 | OPENSEARCH_ADMIN_PASSWORD=VERY%@bad123password 67 | 68 | ### --- VALKEY --- 69 | 70 | VALKEY_TAG=8-1.0.1 71 | #VALKEY_TAG=7-1.0.1 72 | 73 | ### --- NODE --- 74 | 75 | NODE_TAG=22-dev-1.51.0 76 | #NODE_TAG=20-dev-1.51.0 77 | #NODE_TAG=18-dev-1.51.0 78 | 79 | ### --- VARNISH --- 80 | 81 | VARNISH_TAG=6.0-4.21.0 82 | 83 | ### --- POSTGRESQL ---- 84 | 85 | POSTGRES_TAG=17-1.35.6 86 | #POSTGRES_TAG=16-1.35.6 87 | #POSTGRES_TAG=15-1.35.6 88 | #POSTGRES_TAG=14-1.35.6 89 | #POSTGRES_TAG=13-1.35.6 90 | 91 | ### OTHERS 92 | 93 | ADMINER_TAG=5-4.2.4 94 | APACHE_TAG=2.4-4.15.3 95 | MEMCACHED_TAG=1-2.19.1 96 | OPENSMTPD_TAG=7-1.26.0 97 | RSYSLOG_TAG=latest 98 | SELENIUM_CHROME_TAG=3.141 99 | WEBGRIND_TAG=1-1.36.7 100 | XHPROF_TAG=3.14.7 101 | ZOOKEEPER_TAG=3.8 102 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | ***OS type*** 8 | Linux/Windows/macOS 9 | 10 | ***Drupal version*** 11 | 7 / 8 12 | 13 | ***Codebase*** 14 | Built-in vanilla Drupal or mounted codebase 15 | 16 | **Describe the bug** 17 | A clear and concise description of what the bug is. 18 | 19 | **Output of `docker info`** 20 | ``` 21 | Paste here 22 | ``` 23 | 24 | **Contents of your `compose.yml`** 25 | ``` 26 | Paste here 27 | REMOVE COMMENTED LINES 28 | ``` 29 | 30 | **Contents of your `.env`** 31 | ``` 32 | Paste here 33 | REMOVE COMMENTED LINES 34 | ``` 35 | 36 | **Logs output `docker compose logs`** 37 | ``` 38 | Paste here 39 | ``` 40 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Support request 3 | about: Request support from community 4 | 5 | --- 6 | 7 | ***Codebase*** 8 | Built-in vanilla Drupal or mounted codebase 9 | 10 | **Describe your issue** 11 | A clear and concise description of your issue. 12 | 13 | **Output of `docker info`** 14 | ``` 15 | Paste here 16 | ``` 17 | 18 | **Contents of your `compose.yml`** 19 | ``` 20 | Paste here 21 | ``` 22 | 23 | **Contents of your `.env`** 24 | ``` 25 | Paste here 26 | ``` 27 | 28 | **Logs output `docker compose logs`** 29 | ``` 30 | Paste here 31 | ``` 32 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Describe alternatives you've considered** 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | ### Codebase 2 | Built-in vanilla Drupal or mounted codebase 3 | 4 | ### Host OS 5 | e.g. macOS Sierra 6 | 7 | ### Docker info output 8 | ``` 9 | # Run "docker info" on the host machine and paste output here 10 | ``` 11 | 12 | ### Docker compose file 13 | Make sure you remove all commented services. 14 | ```yml 15 | # Content of your compose.yml file. Make sure you remove all sensible information you might have there. 16 | ``` 17 | 18 | ### .env file 19 | ``` 20 | # Content of .env file. Make sure you remove all sensible information you might have there. 21 | ``` 22 | 23 | ### Logs output 24 | ``` 25 | # Run "docker compose logs [service]". Let's say you get 500 error for some reason then it'll be helpful to provide logs for php and http server (nginx/apache) services. 26 | ``` 27 | -------------------------------------------------------------------------------- /.github/workflows/workflow.yml: -------------------------------------------------------------------------------- 1 | name: Run tests 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | tags: 9 | - '*' 10 | 11 | pull_request: 12 | 13 | jobs: 14 | test: 15 | strategy: 16 | matrix: 17 | drupal_ver: [ 11,10 ] 18 | php_ver: [ '8.4','8.3','8.2','8.1' ] 19 | exclude: 20 | - drupal_ver: 11 21 | php_ver: '8.2' 22 | - drupal_ver: 11 23 | php_ver: '8.1' 24 | runs-on: ubuntu-latest 25 | steps: 26 | - uses: actions/checkout@v4 27 | - name: test 28 | env: 29 | DRUPAL_VER: ${{ matrix.drupal_ver }} 30 | PHP_VER: ${{ matrix.php_ver }} 31 | run: make test 32 | test-cms: 33 | runs-on: ubuntu-latest 34 | steps: 35 | - uses: actions/checkout@v4 36 | - name: test 37 | run: make test-cms 38 | release: 39 | runs-on: ubuntu-latest 40 | if: startsWith(github.ref, 'refs/tags/') 41 | needs: [test,test-cms] 42 | steps: 43 | - uses: actions/checkout@v4 44 | - name: prepare artifact 45 | run: cp docker.mk Makefile && tar -czf docker4drupal.tar.gz compose.yml compose.override.yml Makefile .env traefik.yml 46 | - name: get tag name 47 | id: vars 48 | run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} 49 | - uses: xresloader/upload-to-github-release@v1 50 | id: upload_artifact 51 | env: 52 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 53 | with: 54 | file: docker4drupal.tar.gz 55 | overwrite: true 56 | tags: true 57 | draft: false 58 | tag_name: ${{ steps.vars.outputs.tag }} 59 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | mariadb-init 3 | postgres-init 4 | mutagen.yml.lock 5 | .vscode -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2016 Wodby, Inc. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | include docker.mk 2 | 3 | DRUPAL_VER ?= 11 4 | PHP_VER ?= 8.4 5 | 6 | test: 7 | cd ./tests/$(DRUPAL_VER) && PHP_VER=$(PHP_VER) ./run.sh 8 | .PHONY: test 9 | 10 | test-cms: 11 | cd ./tests/cms && ./run.sh 12 | .PHONY: test-cms 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker-based Drupal stack 2 | 3 | [![Build Status](https://github.com/wodby/docker4drupal/workflows/Run%20tests/badge.svg)](https://github.com/wodby/docker4drupal/actions) 4 | 5 | ## Introduction 6 | 7 | Docker4Drupal is a set of docker images optimized for Drupal. Use 8 | `compose.yml` file from the [latest stable release](https://github.com/wodby/docker4drupal/releases) to spin up local environment on Linux, Mac OS X and Windows. 9 | 10 | * Read the docs on [**how to use**](https://wodby.com/docs/stacks/drupal/local#usage) 11 | * Ask questions on [Discord](http://discord.wodby.com/) 12 | * Ask questions on [Slack](http://slack.wodby.com/) 13 | * Follow [@wodbycloud](https://twitter.com/wodbycloud) for future announcements 14 | 15 | ## Stack 16 | 17 | The Drupal stack consist of the following containers: 18 | 19 | | Container | Versions | Image | ARM64 support | Enabled by default | 20 | |-----------------------|-------------------------|-------------------------------------------|---------------|--------------------| 21 | | [Nginx] | 1.28, 1.27 | [wodby/nginx] | ✓ | ✓ | 22 | | [Apache] | 2.4 | [wodby/apache] | ✓ | | 23 | | Drupal CMS | 1 | [wodby/drupal-cms] | ✓ | ✓ | 24 | | Vanilla Drupal | 11, 10 | [wodby/drupal] | ✓ | | 25 | | [PHP] | 8.4, 8.3, 8.2, 8.1 | [wodby/drupal-php] | ✓ | | 26 | | Crond | | [wodby/drupal-php] | ✓ | ✓ | 27 | | [MariaDB] | 11.4, 10.11, 10.6, 10.5 | [wodby/mariadb] | ✓ | ✓ | 28 | | [PostgreSQL] | 17, 16, 15, 14, 13 | [wodby/postgres] | ✓ | | 29 | | [Valkey] | 8, 7 | [wodby/valkey] | ✓ | | 30 | | [Memcached] | 1 | [wodby/memcached] | ✓ | | 31 | | [Varnish] | 6.0 | [wodby/varnish] | ✓ | | 32 | | [Node.js] | 22, 20, 18 | [wodby/node] | ✓ | | 33 | | [Solr] | 9 | [wodby/solr] | ✓ | | 34 | | Zookeeper | 3.8 | [zookeeper] | ✓ | | 35 | | OpenSearch | 2 | [opensearchproject/opensearch] | ✓ | | 36 | | OpenSearch Dashboards | 2 | [opensearchproject/opensearch-dashboards] | ✓ | | 37 | | [OpenSMTPD] | 7 | [wodby/opensmtpd] | ✓ | | 38 | | Mailpit | latest | [axllent/mailpit] | ✓ | ✓ | 39 | | Gotenberg | latest | [gotenberg/gotenberg] | ✓ | | 40 | | [Rsyslog] | latest | [wodby/rsyslog] | ✓ | | 41 | | [Webgrind] | 1 | [wodby/webgrind] | ✓ | | 42 | | [Xhprof viewer] | latest | [wodby/xhprof] | ✓ | | 43 | | Adminer | 5 | [wodby/adminer] | ✓ | | 44 | | phpMyAdmin | latest | [phpmyadmin/phpmyadmin] | | | 45 | | Selenium chrome | 3.141 | [selenium/standalone-chrome] | | | 46 | | Traefik | latest | [_/traefik] | ✓ | ✓ | 47 | 48 | ## Documentation 49 | 50 | Full documentation is available at https://wodby.com/docs/stacks/drupal/local. 51 | 52 | ## Image's tags 53 | 54 | Images' tags format is `[VERSION]-[STABILITY_TAG]` where: 55 | 56 | `[VERSION]` is the _version of an application_ (without patch version) running in a container, e.g. 57 | `wodby/nginx:1.15-x.x.x` where Nginx version is `1.15` and 58 | `x.x.x` is a stability tag. For some images we include both major and minor version like PHP 59 | `7.2`, for others we include only major like Valkey `7`. 60 | 61 | `[STABILITY_TAG]` is the _version of an image_ that corresponds to a git tag of the image repository, e.g. 62 | `wodby/mariadb:10.2-3.3.8` has MariaDB `10.2` and stability tag [ 63 | `3.3.8`](https://github.com/wodby/mariadb/releases/tag/3.3.8). New stability tags include patch updates for applications and image's fixes/improvements (new env vars, orchestration actions fixes, etc). Stability tag changes described in the corresponding a git tag description. Stability tags follow [semantic versioning](https://semver.org/). 64 | 65 | We highly encourage to use images only with stability tags. 66 | 67 | ## Maintenance 68 | 69 | We regularly update images used in this stack and release them together, see [releases page](https://github.com/wodby/docker4drupal/releases) for full changelog and update instructions. Most of routine updates for images and this project performed by [the bot](https://github.com/wodbot) via scripts located at [wodby/images](https://github.com/wodby/images). 70 | 71 | ## Beyond local environment 72 | 73 | Docker4Drupal is a project designed to help you spin up local environment with Docker Compose. If you want to deploy a consistent stack with orchestrations to your own server, check out [Drupal stack](https://wodby.com/stacks/drupal) on Wodby ![](https://www.google.com/s2/favicons?domain=wodby.com). 74 | 75 | ## Other Docker4x projects 76 | 77 | * [docker4php](https://github.com/wodby/docker4php) 78 | * [docker4laravel](https://github.com/wodby/docker4laravel) 79 | * [docker4wordpress](https://github.com/wodby/docker4wordpress) 80 | * [docker4ruby](https://github.com/wodby/docker4ruby) 81 | * [docker4python](https://github.com/wodby/docker4python) 82 | 83 | ## License 84 | 85 | This project is licensed under the MIT open source license. 86 | 87 | [Apache]: https://wodby.com/docs/stacks/drupal/containers#apache 88 | 89 | [Drupal CMS]: https://wodby.com/docs/stacks/drupal/containers#php 90 | 91 | [Vanilla Drupal]: https://wodby.com/docs/stacks/drupal/containers#php 92 | 93 | [MariaDB]: https://wodby.com/docs/stacks/drupal/containers#mariadb 94 | 95 | [Memcached]: https://wodby.com/docs/stacks/drupal/containers#memcached 96 | 97 | [Nginx]: https://wodby.com/docs/stacks/drupal/containers#nginx 98 | 99 | [Node.js]: https://wodby.com/docs/stacks/drupal/containers#nodejs 100 | 101 | [OpenSMTPD]: https://wodby.com/docs/stacks/drupal/containers#opensmtpd 102 | 103 | [PHP]: https://wodby.com/docs/stacks/drupal/containers#php 104 | 105 | [PostgreSQL]: https://wodby.com/docs/stacks/drupal/containers#postgresql 106 | 107 | [Redis]: https://wodby.com/docs/stacks/drupal/containers#redis 108 | 109 | [Valkey]: https://wodby.com/docs/stacks/valkey/containers#valkey 110 | 111 | [Rsyslog]: https://wodby.com/docs/stacks/drupal/containers#rsyslog 112 | 113 | [Solr]: https://wodby.com/docs/stacks/drupal/containers#solr 114 | 115 | [Varnish]: https://wodby.com/docs/stacks/drupal/containers#varnish 116 | 117 | [Webgrind]: https://wodby.com/docs/stacks/drupal/containers#webgrind 118 | 119 | [XHProf viewer]: https://wodby.com/docs/stacks/php/containers#xhprof-viewer 120 | 121 | [_/traefik]: https://hub.docker.com/_/traefik 122 | 123 | [gotenberg/gotenberg]: https://hub.docker.com/r/gotenberg/gotenberg 124 | 125 | [axllent/mailpit]: https://hub.docker.com/r/axllent/mailpit 126 | 127 | [phpmyadmin/phpmyadmin]: https://hub.docker.com/r/phpmyadmin/phpmyadmin 128 | 129 | [selenium/standalone-chrome]: https://hub.docker.com/r/selenium/standalone-chrome 130 | 131 | [wodby/adminer]: https://hub.docker.com/r/wodby/adminer 132 | 133 | [wodby/apache]: https://github.com/wodby/apache 134 | 135 | [wodby/drupal-php]: https://github.com/wodby/drupal-php 136 | 137 | [wodby/drupal]: https://github.com/wodby/drupal 138 | 139 | [wodby/drupal-cms]: https://github.com/wodby/drupal-cms 140 | 141 | [wodby/mariadb]: https://github.com/wodby/mariadb 142 | 143 | [wodby/memcached]: https://github.com/wodby/memcached 144 | 145 | [wodby/nginx]: https://github.com/wodby/nginx 146 | 147 | [wodby/node]: https://github.com/wodby/node 148 | 149 | [wodby/opensmtpd]: https://github.com/wodby/opensmtpd 150 | 151 | [wodby/postgres]: https://github.com/wodby/postgres 152 | 153 | [wodby/valkey]: https://github.com/wodby/valkey 154 | 155 | [wodby/rsyslog]: https://hub.docker.com/r/wodby/rsyslog 156 | 157 | [wodby/solr]: https://github.com/wodby/solr 158 | 159 | [wodby/varnish]: https://github.com/wodby/varnish 160 | 161 | [wodby/webgrind]: https://hub.docker.com/r/wodby/webgrind 162 | 163 | [wodby/xhprof]: https://hub.docker.com/r/wodby/xhprof 164 | 165 | [zookeeper]: https://hub.docker.com/_/zookeeper 166 | 167 | [opensearchproject/opensearch]: https://hub.docker.com/r/opensearchproject/opensearch 168 | 169 | [opensearchproject/opensearch-dashboards]: https://hub.docker.com/r/opensearchproject/opensearch-dashboards 170 | -------------------------------------------------------------------------------- /compose.override.yml: -------------------------------------------------------------------------------- 1 | services: 2 | php: 3 | image: wodby/drupal-cms:$DRUPAL_CMS_TAG 4 | # image: wodby/drupal:$DRUPAL_TAG 5 | environment: 6 | PHP_FPM_CLEAR_ENV: "no" 7 | volumes: 8 | - codebase:/var/www/html 9 | 10 | crond: 11 | image: wodby/drupal-cms:$DRUPAL_CMS_TAG 12 | # image: wodby/drupal:$DRUPAL_TAG 13 | environment: 14 | PHP_FPM_CLEAR_ENV: "no" 15 | volumes: 16 | - codebase:/var/www/html 17 | 18 | nginx: 19 | volumes: 20 | - codebase:/var/www/html 21 | 22 | # webgrind: 23 | # volumes: 24 | # - codebase:/mnt/codebase 25 | 26 | volumes: 27 | codebase: 28 | -------------------------------------------------------------------------------- /compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | mariadb: 3 | image: wodby/mariadb:$MARIADB_TAG 4 | container_name: "${PROJECT_NAME}_mariadb" 5 | stop_grace_period: 30s 6 | environment: 7 | MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD 8 | MYSQL_DATABASE: $DB_NAME 9 | MYSQL_USER: $DB_USER 10 | MYSQL_PASSWORD: $DB_PASSWORD 11 | MYSQL_TRANSACTION_ISOLATION: READ-COMMITTED 12 | # volumes: 13 | # - ./mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here. 14 | # - /path/to/mariadb/data/on/host:/var/lib/mysql # Use bind mount 15 | 16 | php: 17 | image: wodby/drupal-php:$PHP_TAG 18 | container_name: "${PROJECT_NAME}_php" 19 | environment: 20 | # By default xdebug extension also disabled. 21 | PHP_EXTENSIONS_DISABLE: xhprof,spx 22 | PHP_MAIL_MIXED_LF_AND_CRLF: 'On' 23 | # Mailpit: 24 | MSMTP_HOST: mailpit 25 | MSMTP_PORT: 1025 26 | # # OpenSMTPD: 27 | # MSMTP_HOST: opensmtpd 28 | # MSMTP_PORT: 25 29 | # DB_HOST: $DB_HOST 30 | # DB_PORT: $DB_PORT 31 | # DB_USER: $DB_USER 32 | # DB_PASSWORD: $DB_PASSWORD 33 | # DB_NAME: $DB_NAME 34 | # DB_DRIVER: $DB_DRIVER 35 | # DRUSH_OPTIONS_URI: "http://${PROJECT_BASE_URL}:${PROJECT_PORT}" 36 | # PHP_FPM_USER: wodby 37 | # PHP_FPM_GROUP: wodby 38 | # COLUMNS: 80 # Set 80 columns for docker exec -it. 39 | # # Read instructions at https://wodby.com/docs/stacks/php/local/#xdebug 40 | # PHP_XDEBUG_MODE: debug 41 | # PHP_XDEBUG_MODE: profile 42 | # PHP_XDEBUG_USE_COMPRESSION: false 43 | # PHP_IDE_CONFIG: serverName=my-ide 44 | # PHP_XDEBUG_IDEKEY: "my-ide" 45 | # PHP_XDEBUG_LOG: /tmp/php-xdebug.log 46 | # # PHPUnit Drupal testing configurations 47 | # SIMPLETEST_BASE_URL: "http://nginx" 48 | # SIMPLETEST_DB: "${DB_DRIVER}://${DB_USER}:${DB_PASSWORD}@${DB_HOST}/${DB_NAME}#tests_" 49 | # MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","goog:chromeOptions":{"args":["--disable-gpu","--headless"]}}, "http://chrome:9515"]' 50 | extra_hosts: 51 | - "host.docker.internal:host-gateway" 52 | volumes: 53 | - ./:/var/www/html:cached 54 | ## Alternative for macOS users: Mutagen https://wodby.com/docs/stacks/drupal/local#docker-for-mac 55 | # - drupal:/var/www/html 56 | ## For XHProf and Xdebug profiler traces 57 | # - files:/mnt/files 58 | 59 | crond: 60 | init: true 61 | image: wodby/drupal-php:$PHP_TAG 62 | container_name: "${PROJECT_NAME}_crond" 63 | environment: 64 | CRONTAB: "0 * * * * drush -r /var/www/html/web cron" 65 | command: sudo -E crond -f -d 0 66 | volumes: 67 | - ./:/var/www/html:cached 68 | ## Alternative for macOS users: Mutagen https://wodby.com/docs/stacks/drupal/local#docker-for-mac 69 | # - drupal:/var/www/html 70 | 71 | nginx: 72 | image: wodby/nginx:$NGINX_TAG 73 | container_name: "${PROJECT_NAME}_nginx" 74 | depends_on: 75 | - php 76 | environment: 77 | NGINX_STATIC_OPEN_FILE_CACHE: "off" 78 | NGINX_ERROR_LOG_LEVEL: debug 79 | NGINX_BACKEND_HOST: php 80 | NGINX_SERVER_ROOT: /var/www/html/web 81 | NGINX_VHOST_PRESET: $NGINX_VHOST_PRESET 82 | # NGINX_DRUPAL_FILE_PROXY_URL: http://example.com 83 | volumes: 84 | - ./:/var/www/html:cached 85 | ## Alternative for macOS users: Mutagen https://wodby.com/docs/stacks/drupal/local#docker-for-mac 86 | # - drupal:/var/www/html 87 | labels: 88 | - "traefik.http.routers.${PROJECT_NAME}_nginx.rule=Host(`${PROJECT_BASE_URL}`)" 89 | 90 | mailpit: 91 | image: axllent/mailpit 92 | container_name: "${PROJECT_NAME}_mailpit" 93 | labels: 94 | - "traefik.http.services.${PROJECT_NAME}_mailpit.loadbalancer.server.port=8025" 95 | - "traefik.http.routers.${PROJECT_NAME}_mailpit.rule=Host(`mailpit.${PROJECT_BASE_URL}`)" 96 | 97 | # postgres: 98 | # image: wodby/postgres:$POSTGRES_TAG 99 | # container_name: "${PROJECT_NAME}_postgres" 100 | # stop_grace_period: 30s 101 | # environment: 102 | # POSTGRES_PASSWORD: $DB_PASSWORD 103 | # POSTGRES_DB: $DB_NAME 104 | # POSTGRES_USER: $DB_USER 105 | # POSTGRES_DB_EXTENSIONS: pg_trgm 106 | # volumes: 107 | # - ./postgres-init:/docker-entrypoint-initdb.d # Place init file(s) here. 108 | # - /path/to/postgres/data/on/host:/var/lib/postgresql/data # Use bind mount 109 | 110 | # apache: 111 | # image: wodby/apache:$APACHE_TAG 112 | # container_name: "${PROJECT_NAME}_apache" 113 | # depends_on: 114 | # - php 115 | # environment: 116 | # APACHE_LOG_LEVEL: debug 117 | # APACHE_BACKEND_HOST: php 118 | # APACHE_VHOST_PRESET: php 119 | # APACHE_DOCUMENT_ROOT: /var/www/html/web 120 | # volumes: 121 | # - ./:/var/www/html:cached 122 | ## Alternative for macOS users: Mutagen https://wodby.com/docs/stacks/drupal/local#docker-for-mac 123 | # - drupal:/var/www/html 124 | 125 | # labels: 126 | # - "traefik.http.routers.${PROJECT_NAME}_apache.rule=Host(`${PROJECT_BASE_URL}`)" 127 | 128 | # varnish: 129 | # image: wodby/varnish:$VARNISH_TAG 130 | # container_name: "${PROJECT_NAME}_varnish" 131 | # depends_on: 132 | # - nginx 133 | # environment: 134 | # VARNISH_SECRET: secret 135 | # VARNISH_BACKEND_HOST: nginx 136 | # VARNISH_BACKEND_PORT: 80 137 | # VARNISH_CONFIG_PRESET: drupal 138 | # VARNISH_ALLOW_UNRESTRICTED_PURGE: 1 139 | # labels: 140 | # - "traefik.http.services.${PROJECT_NAME}_varnish.loadbalancer.server.port=6081" 141 | # - "traefik.http.routers.${PROJECT_NAME}_varnish.rule=Host(`varnish.${PROJECT_BASE_URL}`)" 142 | 143 | # valkey: 144 | # container_name: "${PROJECT_NAME}_valkey" 145 | # image: wodby/valkey:$VALKEY_TAG 146 | 147 | # adminer: 148 | # container_name: "${PROJECT_NAME}_adminer" 149 | # init: true 150 | # image: wodby/adminer:$ADMINER_TAG 151 | # environment: 152 | # # For PostgreSQL: 153 | # # ADMINER_DEFAULT_DB_DRIVER: pgsql 154 | # ADMINER_DEFAULT_DB_HOST: $DB_HOST 155 | # ADMINER_DEFAULT_DB_NAME: $DB_NAME 156 | # labels: 157 | # - "traefik.http.routers.${PROJECT_NAME}_adminer.rule=Host(`adminer.${PROJECT_BASE_URL}`)" 158 | 159 | # pma: 160 | # image: phpmyadmin/phpmyadmin 161 | # container_name: "${PROJECT_NAME}_pma" 162 | # environment: 163 | # PMA_HOST: $DB_HOST 164 | # PMA_USER: $DB_USER 165 | # PMA_PASSWORD: $DB_PASSWORD 166 | # UPLOAD_LIMIT: 1G 167 | # labels: 168 | # - "traefik.http.routers.${PROJECT_NAME}_pma.rule=Host(`pma.${PROJECT_BASE_URL}`)" 169 | 170 | # solr: 171 | # image: wodby/solr:$SOLR_TAG 172 | # container_name: "${PROJECT_NAME}_solr" 173 | # environment: 174 | # SOLR_OPTS: "-Dsolr.config.lib.enabled=true" 175 | # SOLR_MODULES: extraction,langid,ltr,analysis-extras 176 | # ZK_HOST: zookeeper:2181 177 | # SOLR_HEAP: 1024m 178 | # depends_on: 179 | # - zookeeper 180 | # labels: 181 | # - "traefik.http.services.${PROJECT_NAME}_solr.loadbalancer.server.port=8983" 182 | # - "traefik.http.routers.${PROJECT_NAME}_solr.rule=Host(`solr.${PROJECT_BASE_URL}`)" 183 | 184 | # zookeeper: 185 | # image: zookeeper:$ZOOKEEPER_TAG 186 | # container_name: "${PROJECT_NAME}_zookeeper" 187 | # environment: 188 | # ZOO_MY_ID: 1 189 | # ZOO_SERVERS: server.1=zookeeper:2888:3888;2181 190 | # ZOO_4LW_COMMANDS_WHITELIST: mntr, conf, ruok 191 | 192 | # memcached: 193 | # container_name: "${PROJECT_NAME}_memcached" 194 | # image: wodby/memcached:$MEMCACHED_TAG 195 | 196 | # rsyslog: 197 | # container_name: "${PROJECT_NAME}_rsyslog" 198 | # image: wodby/rsyslog:$RSYSLOG_TAG 199 | 200 | # gotenberg: 201 | # image: gotenberg/gotenberg 202 | # container_name: "${PROJECT_NAME}_gotenberg" 203 | 204 | # node: 205 | # image: wodby/node:$NODE_TAG 206 | # container_name: "${PROJECT_NAME}_node" 207 | # working_dir: /var/www/html/path/to/theme/to/build 208 | # labels: 209 | # - "traefik.http.services.${PROJECT_NAME}_node.loadbalancer.server.port=3000" 210 | # - "traefik.http.routers.${PROJECT_NAME}_node.rule=Host(`node.${PROJECT_BASE_URL}`)" 211 | # expose: 212 | # - "3000" 213 | # volumes: 214 | # - ./:/var/www/html 215 | # command: sh -c 'yarn install && yarn run start' 216 | 217 | # webgrind: 218 | # image: wodby/webgrind:$WEBGRIND_TAG 219 | # container_name: "${PROJECT_NAME}_webgrind" 220 | # environment: 221 | # WEBGRIND_PROFILER_DIR: /mnt/files/xdebug 222 | # labels: 223 | # - "traefik.http.routers.${PROJECT_NAME}_webgrind.rule=Host(`webgrind.${PROJECT_BASE_URL}`)" 224 | # volumes: 225 | # - files:/mnt/files 226 | # - ./:/mnt/codebase:cached 227 | 228 | # opensearch: 229 | # image: opensearchproject/opensearch:$OPENSEARCH_TAG 230 | # environment: 231 | # "discovery.type": "single-node" 232 | # "plugins.security.disabled": true 233 | # OPENSEARCH_INITIAL_ADMIN_PASSWORD: $OPENSEARCH_ADMIN_PASSWORD 234 | # 235 | # opensearch-dashboards: 236 | # image: opensearchproject/opensearch-dashboards:$OPENSEARCH_TAG 237 | # environment: 238 | # OPENSEARCH_HOSTS: '["http://opensearch:9200"]' 239 | # DISABLE_SECURITY_DASHBOARDS_PLUGIN: true 240 | # depends_on: 241 | # - opensearch 242 | # labels: 243 | # - "traefik.http.services.${PROJECT_NAME}_opensearch.loadbalancer.server.port=5601" 244 | # - "traefik.http.routers.${PROJECT_NAME}_opensearch.rule=Host(`opensearch.${PROJECT_BASE_URL}`)" 245 | 246 | # opensmtpd: 247 | # container_name: "${PROJECT_NAME}_opensmtpd" 248 | # image: wodby/opensmtpd:$OPENSMTPD_TAG 249 | 250 | # xhprof: 251 | # image: wodby/xhprof:$XHPROF_TAG 252 | # container_name: "${PROJECT_NAME}_xhprof" 253 | # restart: always 254 | # volumes: 255 | # - files:/mnt/files 256 | # labels: 257 | # - "traefik.http.routers.${PROJECT_NAME}_xhprof.rule=Host(`xhprof.${PROJECT_BASE_URL}`)" 258 | 259 | # chrome: 260 | # image: selenium/standalone-chrome:$SELENIUM_CHROME_TAG 261 | # container_name: "${PROJECT_NAME}_chrome" 262 | # volumes: 263 | # - /dev/shm:/dev/shm 264 | # entrypoint: 265 | # - chromedriver 266 | # - "--no-sandbox" 267 | # - "--disable-dev-shm-usage" 268 | # - "--log-path=/tmp/chromedriver.log" 269 | # - "--verbose" 270 | # - "--whitelisted-ips=" 271 | 272 | traefik: 273 | image: traefik:v2.0 274 | container_name: "${PROJECT_NAME}_traefik" 275 | command: --api.insecure=true --providers.docker 276 | ports: 277 | - "${PROJECT_PORT}:80" 278 | # - '8080:8080' # Dashboard 279 | volumes: 280 | - /var/run/docker.sock:/var/run/docker.sock 281 | 282 | #x-mutagen: 283 | # sync: 284 | # defaults: 285 | # ignore: 286 | # vcs: true 287 | # paths: 288 | # - .DS_Store 289 | # - .history 290 | # - .idea 291 | # drupal: 292 | # alpha: "." 293 | # beta: "volume://drupal" 294 | # configurationBeta: 295 | # permissions: 296 | # defaultFileMode: 0644 297 | # defaultDirectoryMode: 0755 298 | # defaultOwner: "id:501" 299 | # defaultGroup: "id:20" 300 | 301 | volumes: 302 | ## For macOS users (Mutagen) 303 | # drupal: 304 | # For Xdebug profiler 305 | files: 306 | -------------------------------------------------------------------------------- /docker.mk: -------------------------------------------------------------------------------- 1 | include .env 2 | 3 | default: up 4 | 5 | COMPOSER_ROOT ?= /var/www/html 6 | DRUPAL_ROOT ?= /var/www/html/web 7 | 8 | ## help : Print commands help. 9 | .PHONY: help 10 | ifneq (,$(wildcard docker.mk)) 11 | help : docker.mk 12 | @sed -n 's/^##//p' $< 13 | else 14 | help : Makefile 15 | @sed -n 's/^##//p' $< 16 | endif 17 | 18 | ## up : Start up containers. 19 | .PHONY: up 20 | up: 21 | @echo "Starting up containers for $(PROJECT_NAME)..." 22 | docker compose pull 23 | docker compose up -d --remove-orphans 24 | 25 | .PHONY: mutagen 26 | mutagen: 27 | mutagen-compose up 28 | 29 | ## down : Stop containers. 30 | .PHONY: down 31 | down: stop 32 | 33 | ## start : Start containers without updating. 34 | .PHONY: start 35 | start: 36 | @echo "Starting containers for $(PROJECT_NAME) from where you left off..." 37 | @docker compose start 38 | 39 | ## stop : Stop containers. 40 | .PHONY: stop 41 | stop: 42 | @echo "Stopping containers for $(PROJECT_NAME)..." 43 | @docker compose stop 44 | 45 | ## prune : Remove containers and their volumes. 46 | ## You can optionally pass an argument with the service name to prune single container 47 | ## prune mariadb : Prune `mariadb` container and remove its volumes. 48 | ## prune mariadb solr : Prune `mariadb` and `solr` containers and remove their volumes. 49 | .PHONY: prune 50 | prune: 51 | @echo "Removing containers for $(PROJECT_NAME)..." 52 | @docker compose down -v $(filter-out $@,$(MAKECMDGOALS)) 53 | 54 | ## ps : List running containers. 55 | .PHONY: ps 56 | ps: 57 | @docker ps --filter name='$(PROJECT_NAME)*' 58 | 59 | ## shell : Access `php` container via shell. 60 | ## You can optionally pass an argument with a service name to open a shell on the specified container 61 | .PHONY: shell 62 | shell: 63 | docker exec -ti -e COLUMNS=$(shell tput cols) -e LINES=$(shell tput lines) $(shell docker ps --filter name='$(PROJECT_NAME)_$(or $(filter-out $@,$(MAKECMDGOALS)), 'php')' --format "{{ .ID }}") sh 64 | 65 | ## composer : Executes `composer` command in a specified `COMPOSER_ROOT` directory (default is `/var/www/html`). 66 | ## To use "--flag" arguments include them in quotation marks. 67 | ## For example: make composer "update drupal/core --with-dependencies" 68 | .PHONY: composer 69 | composer: 70 | docker exec $(shell docker ps --filter name='^/$(PROJECT_NAME)_php' --format "{{ .ID }}") composer --working-dir=$(COMPOSER_ROOT) $(filter-out $@,$(MAKECMDGOALS)) 71 | 72 | ## drush : Executes `drush` command in a specified `DRUPAL_ROOT` directory (default is `/var/www/html/web`). 73 | ## To use "--flag" arguments include them in quotation marks. 74 | ## For example: make drush "watchdog:show --type=cron" 75 | .PHONY: drush 76 | drush: 77 | docker exec $(shell docker ps --filter name='^/$(PROJECT_NAME)_php' --format "{{ .ID }}") drush -r $(DRUPAL_ROOT) $(filter-out $@,$(MAKECMDGOALS)) 78 | 79 | ## logs : View containers logs. 80 | ## You can optinally pass an argument with the service name to limit logs 81 | ## logs php : View `php` container logs. 82 | ## logs nginx php : View `nginx` and `php` containers logs. 83 | .PHONY: logs 84 | logs: 85 | @docker compose logs -f $(filter-out $@,$(MAKECMDGOALS)) 86 | 87 | # https://stackoverflow.com/a/6273809/1826109 88 | %: 89 | @: 90 | -------------------------------------------------------------------------------- /tests/10/.env: -------------------------------------------------------------------------------- 1 | DB_NAME=drupal 2 | DB_USER=drupal 3 | DB_PASSWORD=drupal 4 | DB_ROOT_PASSWORD=password 5 | DB_HOST=mariadb 6 | DB_DRIVER=mysql 7 | 8 | MARIADB_TAG=11.4-3.32.0 9 | VALKEY_TAG=8-1.0.1 10 | VARNISH_TAG=6.0-4.21.0 11 | SOLR_TAG=9-5.1.6 12 | 13 | NGINX_VHOST_PRESET=drupal10 14 | NGINX_TAG=1.27-5.43.0 15 | DRUPAL_STABILITY_TAG=4.81.12 16 | ZOOKEEPER_TAG=3.8 -------------------------------------------------------------------------------- /tests/10/compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | mariadb: 3 | image: wodby/mariadb:$MARIADB_TAG 4 | environment: 5 | MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD 6 | MYSQL_DATABASE: $DB_NAME 7 | MYSQL_USER: $DB_USER 8 | MYSQL_PASSWORD: $DB_PASSWORD 9 | 10 | php: 11 | image: "wodby/drupal:10-${PHP_VER}-${DRUPAL_STABILITY_TAG}" 12 | environment: 13 | # To skip auto init. 14 | WODBY_APP_NAME: drupal 15 | DEBUG: 1 16 | DRUPAL_VERSION: 10 17 | DB_HOST: $DB_HOST 18 | DB_NAME: $DB_NAME 19 | DB_USER: $DB_USER 20 | DB_PASSWORD: $DB_PASSWORD 21 | DB_DRIVER: $DB_DRIVER 22 | PHP_SENDMAIL_PATH: '/bin/true' 23 | COLUMNS: 80 24 | PHP_FPM_USER: wodby 25 | PHP_FPM_GROUP: wodby 26 | COMPOSER_MEMORY_LIMIT: -1 27 | PHP_ERROR_REPORTING: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED 28 | volumes: 29 | - codebase:/var/www/html 30 | - ./tests.sh:/usr/local/bin/tests.sh 31 | - ./test.settings.php:/var/www/html/web/sites/default/test.settings.php 32 | - ./varnish-purger.yml:/var/www/html/varnish-purger.yml 33 | - ./search_api.server.solr.yml:/var/www/html/solr/search_api.server.solr.yml 34 | 35 | nginx: 36 | image: wodby/nginx:$NGINX_TAG 37 | environment: 38 | NGINX_STATIC_OPEN_FILE_CACHE: "off" 39 | NGINX_BACKEND_HOST: php 40 | NGINX_SERVER_ROOT: /var/www/html/web 41 | NGINX_VHOST_PRESET: $NGINX_VHOST_PRESET 42 | volumes: 43 | - codebase:/var/www/html 44 | depends_on: 45 | - php 46 | 47 | varnish: 48 | image: wodby/varnish:$VARNISH_TAG 49 | depends_on: 50 | - nginx 51 | environment: 52 | VARNISH_SECRET: secret 53 | VARNISH_BACKEND_HOST: nginx 54 | VARNISH_BACKEND_PORT: 80 55 | VARNISH_CONFIG_PRESET: drupal 56 | VARNISH_PURGE_EXTERNAL_REQUEST_HEADER: X-Real-IP 57 | 58 | valkey: 59 | image: wodby/valkey:$VALKEY_TAG 60 | environment: 61 | VALKEY_PASSWORD: bad-password 62 | 63 | solr: 64 | image: wodby/solr:$SOLR_TAG 65 | environment: 66 | ZK_HOST: zookeeper:2181 67 | depends_on: 68 | - zookeeper 69 | 70 | zookeeper: 71 | image: zookeeper:$ZOOKEEPER_TAG 72 | environment: 73 | ZOO_MY_ID: 1 74 | ZOO_SERVERS: server.1=zookeeper:2888:3888;2181 75 | ZOO_4LW_COMMANDS_WHITELIST: mntr, conf, ruok 76 | 77 | volumes: 78 | codebase: 79 | -------------------------------------------------------------------------------- /tests/10/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [[ -n "${DEBUG}" ]]; then 6 | set -x 7 | fi 8 | 9 | docker compose up -d 10 | docker compose exec -T mariadb make check-ready -f /usr/local/bin/actions.mk max_try=12 wait_seconds=5 11 | docker compose exec -T solr make check-ready -f /usr/local/bin/actions.mk max_try=12 wait_seconds=3 12 | docker compose exec -T solr make init -f /usr/local/bin/actions.mk 13 | docker compose exec -T --user=0 php apk add --update jq 14 | docker compose exec -T --user=0 php chown -R wodby:wodby /var/www/html 15 | docker compose exec -T php tests.sh 16 | docker compose down 17 | -------------------------------------------------------------------------------- /tests/10/search_api.server.solr.yml: -------------------------------------------------------------------------------- 1 | uuid: ddc2786c-c601-4e6c-a625-b8ce51768ea3 2 | langcode: en 3 | status: true 4 | dependencies: 5 | config: 6 | - search_api_solr.solr_cache.cache_document_default_7_0_0 7 | - search_api_solr.solr_cache.cache_fieldvalue_default_7_0_0 8 | - search_api_solr.solr_cache.cache_filter_default_7_0_0 9 | - search_api_solr.solr_cache.cache_persegfilter_default_7_0_0 10 | - search_api_solr.solr_cache.cache_queryresult_default_7_0_0 11 | - search_api_solr.solr_field_type.text_edge_und_7_0_0 12 | - search_api_solr.solr_field_type.text_edgestring_und_6_0_0 13 | - search_api_solr.solr_field_type.text_en_7_0_0 14 | - search_api_solr.solr_field_type.text_ngram_und_7_0_0 15 | - search_api_solr.solr_field_type.text_ngramstring_und_6_0_0 16 | - search_api_solr.solr_field_type.text_phonetic_en_7_0_0 17 | - search_api_solr.solr_field_type.text_phonetic_und_7_0_0 18 | - search_api_solr.solr_field_type.text_und_7_0_0 19 | - search_api_solr.solr_request_dispatcher.request_dispatcher_httpcachingnever_default_7_0_0 20 | - search_api_solr.solr_request_handler.request_handler_autocomplete_default_7_0_0 21 | - search_api_solr.solr_request_handler.request_handler_extract_default_7_0_0 22 | - search_api_solr.solr_request_handler.request_handler_mlt_default_7_0_0 23 | - search_api_solr.solr_request_handler.request_handler_select_default_7_0_0 24 | - search_api_solr.solr_request_handler.request_handler_spell_default_7_0_0 25 | - search_api_solr.solr_request_handler.request_handler_suggest_default_7_0_0 26 | - search_api_solr.solr_request_handler.request_handler_tvrh_default_7_0_0 27 | module: 28 | - search_api_solr 29 | id: solr 30 | name: solr 31 | description: '' 32 | backend: search_api_solr 33 | backend_config: 34 | retrieve_data: false 35 | highlight_data: false 36 | site_hash: false 37 | server_prefix: '' 38 | domain: generic 39 | environment: default 40 | connector: solr_cloud_basic_auth 41 | connector_config: 42 | scheme: http 43 | host: solr 44 | port: 8983 45 | path: / 46 | core: default 47 | timeout: 5 48 | index_timeout: 5 49 | optimize_timeout: 10 50 | finalize_timeout: 30 51 | skip_schema_check: false 52 | solr_version: '' 53 | http_method: AUTO 54 | commit_within: 1000 55 | jmx: false 56 | jts: false 57 | solr_install_dir: '' 58 | username: solr 59 | password: SolrRocks 60 | checkpoints_collection: '' 61 | stats_cache: org.apache.solr.search.stats.LRUStatsCache 62 | distrib: true 63 | context: solr 64 | optimize: false 65 | fallback_multiple: false 66 | disabled_field_types: { } 67 | disabled_caches: { } 68 | disabled_request_handlers: 69 | - request_handler_elevate_default_7_0_0 70 | - request_handler_replicationmaster_default_7_0_0 71 | - request_handler_replicationslave_default_7_0_0 72 | disabled_request_dispatchers: 73 | - request_dispatcher_httpcaching_default_7_0_0 74 | rows: 10 75 | index_single_documents_fallback_count: 10 76 | index_empty_text_fields: false 77 | suppress_missing_languages: false 78 | -------------------------------------------------------------------------------- /tests/10/test.settings.php: -------------------------------------------------------------------------------- 1 | >"${PWD}/sites/default/settings.php" 71 | 72 | # Enable redis 73 | check_rq "Redis" "Connected" 74 | 75 | check_rq "Trusted Host Settings" "Enabled" 76 | 77 | # Import solr server 78 | #drush cim --source=/var/www/html/solr --partial -y 79 | #drush solr-upload-conf solr 1 80 | #drush sapi-sl | grep -q enabled 81 | 82 | ## Test varnish cache and purge 83 | #drush ppadd varnish 84 | #drush cr 85 | 86 | ## Workaround for varnish purger import https://www.drupal.org/node/2856221 87 | #PURGER_ID=$(drush ppls --format=json | jq -r "keys[0]") 88 | # 89 | #mkdir -p /var/www/html/varnish 90 | ## We copy mounted file because we can't edit mounted file (resource busy error). 91 | #cp /var/www/html/varnish-purger.yml /var/www/html/varnish/purger.yml 92 | #sed -i "s/PLUGIN_ID/${PURGER_ID}/g" /var/www/html/varnish/purger.yml 93 | #mv /var/www/html/varnish/purger.yml "/var/www/html/varnish/varnish_purger.settings.${PURGER_ID}.yml" 94 | #drush -y cim --source=/var/www/html/varnish --partial 95 | #drush -y config-set system.performance cache.page.max_age 43200 96 | # 97 | #curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS" 98 | #curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT" 99 | # 100 | #drush cc render 101 | #drush pqw 102 | # 103 | #curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS" 104 | #curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT" 105 | -------------------------------------------------------------------------------- /tests/10/varnish-purger.yml: -------------------------------------------------------------------------------- 1 | uuid: 91faa2b9-fd7a-4419-8dae-fc5a91b782b6 2 | langcode: en 3 | status: true 4 | dependencies: { } 5 | id: PLUGIN_ID 6 | name: 'Varnish 4.1' 7 | invalidationtype: tag 8 | hostname: varnish 9 | port: 6081 10 | path: / 11 | request_method: BAN 12 | scheme: http 13 | verify: '1' 14 | headers: 15 | - 16 | field: Cache-Tags 17 | value: '[invalidation:expression]' 18 | body: null 19 | body_content_type: null 20 | runtime_measurement: true 21 | timeout: !!float 1 22 | connect_timeout: !!float 1 23 | cooldown_time: !!float 0 24 | max_requests: 100 25 | http_errors: true 26 | -------------------------------------------------------------------------------- /tests/11/.env: -------------------------------------------------------------------------------- 1 | DB_NAME=drupal 2 | DB_USER=drupal 3 | DB_PASSWORD=drupal 4 | DB_ROOT_PASSWORD=password 5 | DB_HOST=mariadb 6 | DB_DRIVER=mysql 7 | 8 | MARIADB_TAG=11.4-3.32.0 9 | VALKEY_TAG=8-1.0.1 10 | VARNISH_TAG=6.0-4.21.0 11 | SOLR_TAG=9-5.1.6 12 | 13 | NGINX_VHOST_PRESET=drupal11 14 | NGINX_TAG=1.27-5.43.0 15 | DRUPAL_STABILITY_TAG=4.81.12 16 | ZOOKEEPER_TAG=3.8 -------------------------------------------------------------------------------- /tests/11/compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | mariadb: 3 | image: wodby/mariadb:$MARIADB_TAG 4 | environment: 5 | MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD 6 | MYSQL_DATABASE: $DB_NAME 7 | MYSQL_USER: $DB_USER 8 | MYSQL_PASSWORD: $DB_PASSWORD 9 | 10 | php: 11 | image: "wodby/drupal:11-${PHP_VER}-${DRUPAL_STABILITY_TAG}" 12 | environment: 13 | # To skip auto init. 14 | WODBY_APP_NAME: drupal 15 | DEBUG: 1 16 | DRUPAL_VERSION: 11 17 | DB_HOST: $DB_HOST 18 | DB_NAME: $DB_NAME 19 | DB_USER: $DB_USER 20 | DB_PASSWORD: $DB_PASSWORD 21 | DB_DRIVER: $DB_DRIVER 22 | PHP_SENDMAIL_PATH: '/bin/true' 23 | COLUMNS: 80 24 | PHP_FPM_USER: wodby 25 | PHP_FPM_GROUP: wodby 26 | COMPOSER_MEMORY_LIMIT: -1 27 | PHP_ERROR_REPORTING: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED 28 | volumes: 29 | - codebase:/var/www/html 30 | - ./tests.sh:/usr/local/bin/tests.sh 31 | - ./test.settings.php:/var/www/html/web/sites/default/test.settings.php 32 | - ./varnish-purger.yml:/var/www/html/varnish-purger.yml 33 | - ./search_api.server.solr.yml:/var/www/html/solr/search_api.server.solr.yml 34 | 35 | nginx: 36 | image: wodby/nginx:$NGINX_TAG 37 | environment: 38 | NGINX_STATIC_OPEN_FILE_CACHE: "off" 39 | NGINX_BACKEND_HOST: php 40 | NGINX_SERVER_ROOT: /var/www/html/web 41 | NGINX_VHOST_PRESET: $NGINX_VHOST_PRESET 42 | volumes: 43 | - codebase:/var/www/html 44 | depends_on: 45 | - php 46 | 47 | varnish: 48 | image: wodby/varnish:$VARNISH_TAG 49 | depends_on: 50 | - nginx 51 | environment: 52 | VARNISH_SECRET: secret 53 | VARNISH_BACKEND_HOST: nginx 54 | VARNISH_BACKEND_PORT: 80 55 | VARNISH_CONFIG_PRESET: drupal 56 | VARNISH_PURGE_EXTERNAL_REQUEST_HEADER: X-Real-IP 57 | 58 | valkey: 59 | image: wodby/valkey:$VALKEY_TAG 60 | environment: 61 | VALKEY_PASSWORD: bad-password 62 | 63 | solr: 64 | image: wodby/solr:$SOLR_TAG 65 | environment: 66 | ZK_HOST: zookeeper:2181 67 | depends_on: 68 | - zookeeper 69 | 70 | zookeeper: 71 | image: zookeeper:$ZOOKEEPER_TAG 72 | environment: 73 | ZOO_MY_ID: 1 74 | ZOO_SERVERS: server.1=zookeeper:2888:3888;2181 75 | ZOO_4LW_COMMANDS_WHITELIST: mntr, conf, ruok 76 | 77 | volumes: 78 | codebase: 79 | -------------------------------------------------------------------------------- /tests/11/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [[ -n "${DEBUG}" ]]; then 6 | set -x 7 | fi 8 | 9 | docker compose up -d 10 | docker compose exec -T mariadb make check-ready -f /usr/local/bin/actions.mk max_try=12 wait_seconds=5 11 | docker compose exec -T solr make check-ready -f /usr/local/bin/actions.mk max_try=12 wait_seconds=3 12 | docker compose exec -T solr make init -f /usr/local/bin/actions.mk 13 | docker compose exec -T --user=0 php apk add --update jq 14 | docker compose exec -T --user=0 php chown -R wodby:wodby /var/www/html 15 | docker compose exec -T php tests.sh 16 | docker compose down 17 | -------------------------------------------------------------------------------- /tests/11/search_api.server.solr.yml: -------------------------------------------------------------------------------- 1 | uuid: ddc2786c-c601-4e6c-a625-b8ce51768ea3 2 | langcode: en 3 | status: true 4 | dependencies: 5 | config: 6 | - search_api_solr.solr_cache.cache_document_default_7_0_0 7 | - search_api_solr.solr_cache.cache_fieldvalue_default_7_0_0 8 | - search_api_solr.solr_cache.cache_filter_default_7_0_0 9 | - search_api_solr.solr_cache.cache_persegfilter_default_7_0_0 10 | - search_api_solr.solr_cache.cache_queryresult_default_7_0_0 11 | - search_api_solr.solr_field_type.text_edge_und_7_0_0 12 | - search_api_solr.solr_field_type.text_edgestring_und_6_0_0 13 | - search_api_solr.solr_field_type.text_en_7_0_0 14 | - search_api_solr.solr_field_type.text_ngram_und_7_0_0 15 | - search_api_solr.solr_field_type.text_ngramstring_und_6_0_0 16 | - search_api_solr.solr_field_type.text_phonetic_en_7_0_0 17 | - search_api_solr.solr_field_type.text_phonetic_und_7_0_0 18 | - search_api_solr.solr_field_type.text_und_7_0_0 19 | - search_api_solr.solr_request_dispatcher.request_dispatcher_httpcachingnever_default_7_0_0 20 | - search_api_solr.solr_request_handler.request_handler_autocomplete_default_7_0_0 21 | - search_api_solr.solr_request_handler.request_handler_extract_default_7_0_0 22 | - search_api_solr.solr_request_handler.request_handler_mlt_default_7_0_0 23 | - search_api_solr.solr_request_handler.request_handler_select_default_7_0_0 24 | - search_api_solr.solr_request_handler.request_handler_spell_default_7_0_0 25 | - search_api_solr.solr_request_handler.request_handler_suggest_default_7_0_0 26 | - search_api_solr.solr_request_handler.request_handler_tvrh_default_7_0_0 27 | module: 28 | - search_api_solr 29 | id: solr 30 | name: solr 31 | description: '' 32 | backend: search_api_solr 33 | backend_config: 34 | retrieve_data: false 35 | highlight_data: false 36 | site_hash: false 37 | server_prefix: '' 38 | domain: generic 39 | environment: default 40 | connector: solr_cloud_basic_auth 41 | connector_config: 42 | scheme: http 43 | host: solr 44 | port: 8983 45 | path: / 46 | core: default 47 | timeout: 5 48 | index_timeout: 5 49 | optimize_timeout: 10 50 | finalize_timeout: 30 51 | skip_schema_check: false 52 | solr_version: '' 53 | http_method: AUTO 54 | commit_within: 1000 55 | jmx: false 56 | jts: false 57 | solr_install_dir: '' 58 | username: solr 59 | password: SolrRocks 60 | checkpoints_collection: '' 61 | stats_cache: org.apache.solr.search.stats.LRUStatsCache 62 | distrib: true 63 | context: solr 64 | optimize: false 65 | fallback_multiple: false 66 | disabled_field_types: { } 67 | disabled_caches: { } 68 | disabled_request_handlers: 69 | - request_handler_elevate_default_7_0_0 70 | - request_handler_replicationmaster_default_7_0_0 71 | - request_handler_replicationslave_default_7_0_0 72 | disabled_request_dispatchers: 73 | - request_dispatcher_httpcaching_default_7_0_0 74 | rows: 10 75 | index_single_documents_fallback_count: 10 76 | index_empty_text_fields: false 77 | suppress_missing_languages: false 78 | -------------------------------------------------------------------------------- /tests/11/test.settings.php: -------------------------------------------------------------------------------- 1 | >"${PWD}/sites/default/settings.php" 67 | 68 | ## Enable redis 69 | #check_rq "Redis" "Connected" 70 | 71 | check_rq "Trusted Host Settings" "Enabled" 72 | 73 | # Import solr server 74 | #drush cim --source=/var/www/html/solr --partial -y 75 | #drush solr-upload-conf solr 1 76 | #drush sapi-sl | grep -q enabled 77 | 78 | ## Test varnish cache and purge 79 | #drush ppadd varnish 80 | #drush cr 81 | 82 | ## Workaround for varnish purger import https://www.drupal.org/node/2856221 83 | #PURGER_ID=$(drush ppls --format=json | jq -r "keys[0]") 84 | # 85 | #mkdir -p /var/www/html/varnish 86 | ## We copy mounted file because we can't edit mounted file (resource busy error). 87 | #cp /var/www/html/varnish-purger.yml /var/www/html/varnish/purger.yml 88 | #sed -i "s/PLUGIN_ID/${PURGER_ID}/g" /var/www/html/varnish/purger.yml 89 | #mv /var/www/html/varnish/purger.yml "/var/www/html/varnish/varnish_purger.settings.${PURGER_ID}.yml" 90 | #drush -y cim --source=/var/www/html/varnish --partial 91 | #drush -y config-set system.performance cache.page.max_age 43200 92 | # 93 | #curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS" 94 | #curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT" 95 | # 96 | #drush cc render 97 | #drush pqw 98 | # 99 | #curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS" 100 | #curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT" 101 | -------------------------------------------------------------------------------- /tests/11/varnish-purger.yml: -------------------------------------------------------------------------------- 1 | uuid: 91faa2b9-fd7a-4419-8dae-fc5a91b782b6 2 | langcode: en 3 | status: true 4 | dependencies: { } 5 | id: PLUGIN_ID 6 | name: 'Varnish 4.1' 7 | invalidationtype: tag 8 | hostname: varnish 9 | port: 6081 10 | path: / 11 | request_method: BAN 12 | scheme: http 13 | verify: '1' 14 | headers: 15 | - 16 | field: Cache-Tags 17 | value: '[invalidation:expression]' 18 | body: null 19 | body_content_type: null 20 | runtime_measurement: true 21 | timeout: !!float 1 22 | connect_timeout: !!float 1 23 | cooldown_time: !!float 0 24 | max_requests: 100 25 | http_errors: true 26 | -------------------------------------------------------------------------------- /tests/cms/.env: -------------------------------------------------------------------------------- 1 | DB_NAME=drupal 2 | DB_USER=drupal 3 | DB_PASSWORD=drupal 4 | DB_ROOT_PASSWORD=password 5 | DB_HOST=mariadb 6 | DB_DRIVER=mysql 7 | 8 | MARIADB_TAG=11.4-3.32.0 9 | VALKEY_TAG=8-1.0.1 10 | VARNISH_TAG=6.0-4.21.0 11 | SOLR_TAG=9-5.1.6 12 | 13 | NGINX_VHOST_PRESET=drupal11 14 | NGINX_TAG=1.27-5.43.0 15 | DRUPAL_CMS_STABILITY_TAG=0.1.0 16 | ZOOKEEPER_TAG=3.8 -------------------------------------------------------------------------------- /tests/cms/compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | mariadb: 3 | image: wodby/mariadb:$MARIADB_TAG 4 | environment: 5 | MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD 6 | MYSQL_DATABASE: $DB_NAME 7 | MYSQL_USER: $DB_USER 8 | MYSQL_PASSWORD: $DB_PASSWORD 9 | 10 | php: 11 | image: "wodby/drupal-cms:1-${DRUPAL_CMS_STABILITY_TAG}" 12 | environment: 13 | # To skip auto init. 14 | WODBY_APP_NAME: drupal 15 | DEBUG: 1 16 | DRUPAL_VERSION: 11 17 | DB_HOST: $DB_HOST 18 | DB_NAME: $DB_NAME 19 | DB_USER: $DB_USER 20 | DB_PASSWORD: $DB_PASSWORD 21 | DB_DRIVER: $DB_DRIVER 22 | PHP_SENDMAIL_PATH: '/bin/true' 23 | COLUMNS: 80 24 | PHP_FPM_USER: wodby 25 | PHP_FPM_GROUP: wodby 26 | COMPOSER_MEMORY_LIMIT: -1 27 | PHP_ERROR_REPORTING: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED 28 | volumes: 29 | - codebase:/var/www/html 30 | - ./tests.sh:/usr/local/bin/tests.sh 31 | - ./test.settings.php:/var/www/html/web/sites/default/test.settings.php 32 | - ./varnish-purger.yml:/var/www/html/varnish-purger.yml 33 | - ./search_api.server.solr.yml:/var/www/html/solr/search_api.server.solr.yml 34 | 35 | nginx: 36 | image: wodby/nginx:$NGINX_TAG 37 | environment: 38 | NGINX_STATIC_OPEN_FILE_CACHE: "off" 39 | NGINX_BACKEND_HOST: php 40 | NGINX_SERVER_ROOT: /var/www/html/web 41 | NGINX_VHOST_PRESET: $NGINX_VHOST_PRESET 42 | volumes: 43 | - codebase:/var/www/html 44 | depends_on: 45 | - php 46 | 47 | varnish: 48 | image: wodby/varnish:$VARNISH_TAG 49 | depends_on: 50 | - nginx 51 | environment: 52 | VARNISH_SECRET: secret 53 | VARNISH_BACKEND_HOST: nginx 54 | VARNISH_BACKEND_PORT: 80 55 | VARNISH_CONFIG_PRESET: drupal 56 | VARNISH_PURGE_EXTERNAL_REQUEST_HEADER: X-Real-IP 57 | 58 | valkey: 59 | image: wodby/valkey:$VALKEY_TAG 60 | environment: 61 | VALKEY_PASSWORD: bad-password 62 | 63 | solr: 64 | image: wodby/solr:$SOLR_TAG 65 | environment: 66 | ZK_HOST: zookeeper:2181 67 | depends_on: 68 | - zookeeper 69 | 70 | zookeeper: 71 | image: zookeeper:$ZOOKEEPER_TAG 72 | environment: 73 | ZOO_MY_ID: 1 74 | ZOO_SERVERS: server.1=zookeeper:2888:3888;2181 75 | ZOO_4LW_COMMANDS_WHITELIST: mntr, conf, ruok 76 | 77 | volumes: 78 | codebase: 79 | -------------------------------------------------------------------------------- /tests/cms/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if [[ -n "${DEBUG}" ]]; then 6 | set -x 7 | fi 8 | 9 | docker compose up -d 10 | docker compose exec -T mariadb make check-ready -f /usr/local/bin/actions.mk max_try=12 wait_seconds=5 11 | docker compose exec -T solr make check-ready -f /usr/local/bin/actions.mk max_try=12 wait_seconds=3 12 | docker compose exec -T solr make init -f /usr/local/bin/actions.mk 13 | docker compose exec -T --user=0 php apk add --update jq 14 | docker compose exec -T --user=0 php chown -R wodby:wodby /var/www/html 15 | docker compose exec -T php tests.sh 16 | docker compose down 17 | -------------------------------------------------------------------------------- /tests/cms/search_api.server.solr.yml: -------------------------------------------------------------------------------- 1 | uuid: ddc2786c-c601-4e6c-a625-b8ce51768ea3 2 | langcode: en 3 | status: true 4 | dependencies: 5 | config: 6 | - search_api_solr.solr_cache.cache_document_default_7_0_0 7 | - search_api_solr.solr_cache.cache_fieldvalue_default_7_0_0 8 | - search_api_solr.solr_cache.cache_filter_default_7_0_0 9 | - search_api_solr.solr_cache.cache_persegfilter_default_7_0_0 10 | - search_api_solr.solr_cache.cache_queryresult_default_7_0_0 11 | - search_api_solr.solr_field_type.text_edge_und_7_0_0 12 | - search_api_solr.solr_field_type.text_edgestring_und_6_0_0 13 | - search_api_solr.solr_field_type.text_en_7_0_0 14 | - search_api_solr.solr_field_type.text_ngram_und_7_0_0 15 | - search_api_solr.solr_field_type.text_ngramstring_und_6_0_0 16 | - search_api_solr.solr_field_type.text_phonetic_en_7_0_0 17 | - search_api_solr.solr_field_type.text_phonetic_und_7_0_0 18 | - search_api_solr.solr_field_type.text_und_7_0_0 19 | - search_api_solr.solr_request_dispatcher.request_dispatcher_httpcachingnever_default_7_0_0 20 | - search_api_solr.solr_request_handler.request_handler_autocomplete_default_7_0_0 21 | - search_api_solr.solr_request_handler.request_handler_extract_default_7_0_0 22 | - search_api_solr.solr_request_handler.request_handler_mlt_default_7_0_0 23 | - search_api_solr.solr_request_handler.request_handler_select_default_7_0_0 24 | - search_api_solr.solr_request_handler.request_handler_spell_default_7_0_0 25 | - search_api_solr.solr_request_handler.request_handler_suggest_default_7_0_0 26 | - search_api_solr.solr_request_handler.request_handler_tvrh_default_7_0_0 27 | module: 28 | - search_api_solr 29 | id: solr 30 | name: solr 31 | description: '' 32 | backend: search_api_solr 33 | backend_config: 34 | retrieve_data: false 35 | highlight_data: false 36 | site_hash: false 37 | server_prefix: '' 38 | domain: generic 39 | environment: default 40 | connector: solr_cloud_basic_auth 41 | connector_config: 42 | scheme: http 43 | host: solr 44 | port: 8983 45 | path: / 46 | core: default 47 | timeout: 5 48 | index_timeout: 5 49 | optimize_timeout: 10 50 | finalize_timeout: 30 51 | skip_schema_check: false 52 | solr_version: '' 53 | http_method: AUTO 54 | commit_within: 1000 55 | jmx: false 56 | jts: false 57 | solr_install_dir: '' 58 | username: solr 59 | password: SolrRocks 60 | checkpoints_collection: '' 61 | stats_cache: org.apache.solr.search.stats.LRUStatsCache 62 | distrib: true 63 | context: solr 64 | optimize: false 65 | fallback_multiple: false 66 | disabled_field_types: { } 67 | disabled_caches: { } 68 | disabled_request_handlers: 69 | - request_handler_elevate_default_7_0_0 70 | - request_handler_replicationmaster_default_7_0_0 71 | - request_handler_replicationslave_default_7_0_0 72 | disabled_request_dispatchers: 73 | - request_dispatcher_httpcaching_default_7_0_0 74 | rows: 10 75 | index_single_documents_fallback_count: 10 76 | index_empty_text_fields: false 77 | suppress_missing_languages: false 78 | -------------------------------------------------------------------------------- /tests/cms/test.settings.php: -------------------------------------------------------------------------------- 1 | >"${PWD}/sites/default/settings.php" 66 | 67 | ## Enable redis 68 | check_rq "Redis" "Connected" 69 | 70 | check_rq "Trusted Host Settings" "Enabled" 71 | 72 | # Import solr server 73 | #drush cim --source=/var/www/html/solr --partial -y 74 | #drush solr-upload-conf solr 1 75 | #drush sapi-sl | grep -q enabled 76 | 77 | ## Test varnish cache and purge 78 | #drush ppadd varnish 79 | #drush cr 80 | 81 | ## Workaround for varnish purger import https://www.drupal.org/node/2856221 82 | #PURGER_ID=$(drush ppls --format=json | jq -r "keys[0]") 83 | # 84 | #mkdir -p /var/www/html/varnish 85 | ## We copy mounted file because we can't edit mounted file (resource busy error). 86 | #cp /var/www/html/varnish-purger.yml /var/www/html/varnish/purger.yml 87 | #sed -i "s/PLUGIN_ID/${PURGER_ID}/g" /var/www/html/varnish/purger.yml 88 | #mv /var/www/html/varnish/purger.yml "/var/www/html/varnish/varnish_purger.settings.${PURGER_ID}.yml" 89 | #drush -y cim --source=/var/www/html/varnish --partial 90 | #drush -y config-set system.performance cache.page.max_age 43200 91 | # 92 | #curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS" 93 | #curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT" 94 | # 95 | #drush cc render 96 | #drush pqw 97 | # 98 | #curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: MISS" 99 | #curl -Is -H 'Host: drupal.localhost' varnish:6081 | grep -q "X-VC-Cache: HIT" 100 | -------------------------------------------------------------------------------- /tests/cms/varnish-purger.yml: -------------------------------------------------------------------------------- 1 | uuid: 91faa2b9-fd7a-4419-8dae-fc5a91b782b6 2 | langcode: en 3 | status: true 4 | dependencies: { } 5 | id: PLUGIN_ID 6 | name: 'Varnish 4.1' 7 | invalidationtype: tag 8 | hostname: varnish 9 | port: 6081 10 | path: / 11 | request_method: BAN 12 | scheme: http 13 | verify: '1' 14 | headers: 15 | - 16 | field: Cache-Tags 17 | value: '[invalidation:expression]' 18 | body: null 19 | body_content_type: null 20 | runtime_measurement: true 21 | timeout: !!float 1 22 | connect_timeout: !!float 1 23 | cooldown_time: !!float 0 24 | max_requests: 100 25 | http_errors: true 26 | -------------------------------------------------------------------------------- /traefik.yml: -------------------------------------------------------------------------------- 1 | services: 2 | traefik: 3 | image: traefik:v2.0 4 | command: --api.insecure=true --providers.docker 5 | networks: 6 | - project1 7 | - project2 8 | ports: 9 | - '80:80' 10 | - '8080:8080' 11 | volumes: 12 | - /var/run/docker.sock:/var/run/docker.sock 13 | 14 | networks: 15 | project1: 16 | external: true 17 | name: project1-dir_default 18 | project2: 19 | external: true 20 | name: project2-dir_default 21 | 22 | --------------------------------------------------------------------------------