diff --git a/CHANGELOG.md b/CHANGELOG.md index fde84719..decfffb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ Changelog", this file is a reverse-chronological list of merged pull requests. ## Open PR's +- [PR-163](https://github.com/itk-dev/devops_itkdev-docker/pull/163) - 2026-11-04 - + The Drupal and Symfony nginx configs include project-specific server config + from `.docker/templates/server.d/*.conf.template`, so project rules survive + `template:update`. Move project changes in `default.conf.template` there - [PR-162](https://github.com/itk-dev/devops_itkdev-docker/pull/162) - 2026-11-02 - Switched the Drupal, Symfony and Drupal module templates to PHP 8.5. The `drupal-10` template stays on PHP 8.4, as Drupal 10 does not support 8.5 diff --git a/README.md b/README.md index 47006118..1621caae 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,18 @@ Run `itkdev-docker-compose template:install drupal-10`, say, to install or updat In addition to the docker compose setup for our projects, installing a template will also add GitHib Actions workflow files to a project; see [Github Actions templates](docs/github-actions-templates.md) for details. +Updating a template overwrites the template files in the project. Keep project-specific changes in files the template +does not ship: + +- `docker-compose.override.yml` and `docker-compose.server.override.yml` for docker compose +- `.docker/templates/server.d/*.conf.template` for nginx (Drupal and Symfony templates). These are included in the + `server` block, and environment variables are substituted as in `default.conf.template`, e.g. + + ```nginx + # .docker/templates/server.d/app-path-prefix.conf.template + rewrite ^${APP_PATH_PREFIX}/(.*) /$1 break; + ``` + ### Docker commands Start containers: `docker-compose up -d` diff --git a/templates/drupal/.docker/templates/default.conf.template b/templates/drupal/.docker/templates/default.conf.template index e77213bd..56b8acf1 100644 --- a/templates/drupal/.docker/templates/default.conf.template +++ b/templates/drupal/.docker/templates/default.conf.template @@ -11,6 +11,9 @@ server { real_ip_recursive on; real_ip_header X-Forwarded-For; + # Project-specific server config (.docker/templates/server.d/*.conf.template). + include /etc/nginx/conf.d/server.d/*.conf; + location = /cron-metrics { # Proxy to supercronic metrics proxy_pass http://${NGINX_CRON_METRICS}/metrics; diff --git a/templates/symfony/.docker/templates/default.conf.template b/templates/symfony/.docker/templates/default.conf.template index 36ddf049..8152d19f 100644 --- a/templates/symfony/.docker/templates/default.conf.template +++ b/templates/symfony/.docker/templates/default.conf.template @@ -11,6 +11,9 @@ server { real_ip_recursive on; real_ip_header X-Forwarded-For; + # Project-specific server config (.docker/templates/server.d/*.conf.template). + include /etc/nginx/conf.d/server.d/*.conf; + location = /cron-metrics { # Proxy to supercronic metrics proxy_pass http://${NGINX_CRON_METRICS}/metrics;