Skip to content

Commit 2a390fa

Browse files
authored
Merge pull request #134 from itk-dev/feature/6566-require-environment-variables
Require some environment variables
2 parents c1b9651 + ffd970d commit 2a390fa

33 files changed

+283
-275
lines changed

.github/workflows/pr.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ name: Review
33
jobs:
44
validate-compose:
55
runs-on: ubuntu-latest
6+
env: &env
7+
# All environment variables that require a non-empty value in our compose
8+
# files (cf.
9+
# https://docs.docker.com/reference/compose-file/interpolation/)
10+
COMPOSE_DOMAIN: test.local.example.org
11+
COMPOSE_PROJECT_NAME: test_project
12+
COMPOSE_SERVER_DOMAIN: test.example.org
613
strategy:
714
fail-fast: false
815
matrix:
@@ -21,20 +28,21 @@ jobs:
2128

2229
- name: Validate local docker compose files
2330
run: |
24-
DC=$(COMPOSE_DOMAIN=example.org docker compose --file templates/${{ matrix.version }}/docker-compose.yml config --quiet 2>&1)
31+
DC=$(docker compose --file templates/${{ matrix.version }}/docker-compose.yml config --quiet 2>&1)
2532
[ -z "$DC" ] || { echo $DC; exit 1; }
2633
2734
- name: Validate server docker compose files
2835
run: |
29-
DC=$(COMPOSE_SERVER_DOMAIN=example.org docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml config --quiet 2>&1)
36+
DC=$(docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml config --quiet 2>&1)
3037
[ -z "$DC" ] || { echo $DC; exit 1; }
31-
DC=$(COMPOSE_SERVER_DOMAIN=example.org docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml --file templates/${{ matrix.version }}/docker-compose.dev.yml config --quiet 2>&1)
38+
DC=$(docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml --file templates/${{ matrix.version }}/docker-compose.dev.yml config --quiet 2>&1)
3239
[ -z "$DC" ] || { echo $DC; exit 1; }
33-
DC=$(COMPOSE_SERVER_DOMAIN=example.org docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml --file templates/${{ matrix.version }}/docker-compose.redirect.yml config --quiet 2>&1)
40+
DC=$(docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml --file templates/${{ matrix.version }}/docker-compose.redirect.yml config --quiet 2>&1)
3441
[ -z "$DC" ] || { echo $DC; exit 1; }
3542
3643
validate-nginx-conf:
3744
runs-on: ubuntu-latest
45+
env: *env
3846
strategy:
3947
fail-fast: false
4048
matrix:
@@ -53,4 +61,4 @@ jobs:
5361
5462
- name: Validate nginx conf
5563
run: |
56-
COMPOSE_DOMAIN=example.org docker compose --file templates/${{ matrix.version }}/${{ matrix.compose_file}} run --rm nginx nginx -t
64+
docker compose --file templates/${{ matrix.version }}/${{ matrix.compose_file}} run --rm nginx nginx -t

templates/drupal-10/docker-compose.dev.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66

77
nginx:
88
labels:
9-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=ITKBasicAuth@file"
9+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}.middlewares=ITKBasicAuth@file"
1010

1111
mail:
1212
image: axllent/mailpit
@@ -17,11 +17,11 @@ services:
1717
labels:
1818
- "traefik.enable=true"
1919
- "traefik.docker.network=frontend"
20-
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}-http.rule=Host(`mail.${COMPOSE_SERVER_DOMAIN}`)"
21-
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}-http.entrypoints=web"
22-
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}-http.middlewares=redirect-to-https"
20+
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME:?}-http.rule=Host(`mail.${COMPOSE_SERVER_DOMAIN:?}`)"
21+
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME:?}-http.entrypoints=web"
22+
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME:?}-http.middlewares=redirect-to-https"
2323
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
24-
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}.rule=Host(`mail.${COMPOSE_SERVER_DOMAIN}`)"
25-
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}.entrypoints=websecure"
26-
- "traefik.http.services.mail_${COMPOSE_PROJECT_NAME}.loadbalancer.server.port=8025"
27-
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}.middlewares=ITKMailhogAuth@file"
24+
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME:?}.rule=Host(`mail.${COMPOSE_SERVER_DOMAIN:?}`)"
25+
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME:?}.entrypoints=websecure"
26+
- "traefik.http.services.mail_${COMPOSE_PROJECT_NAME:?}.loadbalancer.server.port=8025"
27+
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME:?}.middlewares=ITKMailhogAuth@file"

templates/drupal-10/docker-compose.redirect.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ services:
33
nginx:
44
labels:
55
# Add www before domain and set redirect to non-www
6-
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME}-http.rule=Host(`www.${COMPOSE_SERVER_DOMAIN}`)"
7-
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME}-http.entrypoints=web"
8-
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME}-http.middlewares=redirect-to-https,non_www"
9-
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME}.rule=Host(`www.${COMPOSE_SERVER_DOMAIN}`)"
10-
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME}.entrypoints=websecure"
11-
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME}.middlewares=non_www"
6+
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME:?}-http.rule=Host(`www.${COMPOSE_SERVER_DOMAIN:?}`)"
7+
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME:?}-http.entrypoints=web"
8+
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME:?}-http.middlewares=redirect-to-https,non_www"
9+
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME:?}.rule=Host(`www.${COMPOSE_SERVER_DOMAIN:?}`)"
10+
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME:?}.entrypoints=websecure"
11+
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME:?}.middlewares=non_www"
1212

1313
- traefik.http.middlewares.non_www.redirectregex.regex=^(http|https)?://(?:www\.)?(.+)
14-
- traefik.http.middlewares.non_www.redirectregex.replacement=https://$${2}
14+
- traefik.http.middlewares.non_www.redirectregex.replacement=https://$${2:?}
1515
- traefik.http.middlewares.non_www.redirectregex.permanent=true

templates/drupal-10/docker-compose.server.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ services:
1818
- PHP_MAX_EXECUTION_TIME=30
1919
- PHP_MEMORY_LIMIT=128M
2020
# Let drush know the site uri (makes using --uri redundant)
21-
- DRUSH_OPTIONS_URI=https://${COMPOSE_SERVER_DOMAIN}
21+
- DRUSH_OPTIONS_URI=https://${COMPOSE_SERVER_DOMAIN:?}
2222
depends_on:
2323
- memcached
2424
volumes:
@@ -37,23 +37,23 @@ services:
3737
- ./.docker/nginx.conf:/etc/nginx/nginx.conf:ro
3838
- .:/app
3939
environment:
40-
NGINX_FPM_SERVICE: ${COMPOSE_PROJECT_NAME}-phpfpm-1:9000
41-
NGINX_CRON_METRICS: ${COMPOSE_PROJECT_NAME}-phpfpm-1:9746
40+
NGINX_FPM_SERVICE: ${COMPOSE_PROJECT_NAME:?}-phpfpm-1:9000
41+
NGINX_CRON_METRICS: ${COMPOSE_PROJECT_NAME:?}-phpfpm-1:9746
4242
NGINX_WEB_ROOT: /app/web
4343
NGINX_PORT: 8080
4444
NGINX_MAX_BODY_SIZE: 5M
4545
labels:
4646
- "traefik.enable=true"
4747
- "traefik.docker.network=frontend"
48-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-http.rule=Host(`${COMPOSE_SERVER_DOMAIN}`)"
49-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-http.entrypoints=web"
50-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-http.middlewares=redirect-to-https"
48+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}-http.rule=Host(`${COMPOSE_SERVER_DOMAIN:?}`)"
49+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}-http.entrypoints=web"
50+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}-http.middlewares=redirect-to-https"
5151
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
52-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_SERVER_DOMAIN}`)"
53-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure"
52+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}.rule=Host(`${COMPOSE_SERVER_DOMAIN:?}`)"
53+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}.entrypoints=websecure"
5454
# Cron-metrics protection.
55-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-metrics.rule=Host(`${COMPOSE_DOMAIN}`) && PathPrefix(`/cron-metrics`) "
56-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-metrics.middlewares=ITKMetricsAuth@file"
55+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}-metrics.rule=Host(`${COMPOSE_DOMAIN:?}`) && PathPrefix(`/cron-metrics`) "
56+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}-metrics.middlewares=ITKMetricsAuth@file"
5757

5858
memcached:
5959
image: memcached:alpine

templates/drupal-10/docker-compose.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ services:
4242
- PHP_MEMORY_LIMIT=256M
4343
# Depending on the setup, you may have to remove --read-envelope-from from msmtp (cf. https://marlam.de/msmtp/msmtp.html) or use SMTP to send mail
4444
- PHP_SENDMAIL_PATH=/usr/bin/msmtp --host=mail --port=1025 --read-recipients --read-envelope-from
45-
- DOCKER_HOST_DOMAIN=${COMPOSE_DOMAIN}
45+
- DOCKER_HOST_DOMAIN=${COMPOSE_DOMAIN:?}
4646
- PHP_IDE_CONFIG=serverName=localhost
4747
# Let drush know the site uri (makes using --uri redundant)
48-
- DRUSH_OPTIONS_URI=http://${COMPOSE_DOMAIN}
48+
- DRUSH_OPTIONS_URI=http://${COMPOSE_DOMAIN:?}
4949
depends_on:
5050
mariadb:
5151
condition: service_healthy
@@ -67,21 +67,21 @@ services:
6767
- ./.docker/templates:/etc/nginx/templates:ro
6868
- .:/app
6969
environment:
70-
NGINX_FPM_SERVICE: ${COMPOSE_PROJECT_NAME}-phpfpm-1:9000
71-
NGINX_CRON_METRICS: ${COMPOSE_PROJECT_NAME}-phpfpm-1:9746
70+
NGINX_FPM_SERVICE: ${COMPOSE_PROJECT_NAME:?}-phpfpm-1:9000
71+
NGINX_CRON_METRICS: ${COMPOSE_PROJECT_NAME:?}-phpfpm-1:9746
7272
NGINX_WEB_ROOT: /app/web
7373
NGINX_PORT: 8080
7474
NGINX_MAX_BODY_SIZE: 5M
7575
labels:
7676
- "traefik.enable=true"
7777
- "traefik.docker.network=frontend"
78-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_DOMAIN}`)"
78+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}.rule=Host(`${COMPOSE_DOMAIN:?}`)"
7979
# HTTPS config - uncomment to enable redirect from :80 to :443
80-
# - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https"
80+
# - "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}.middlewares=redirect-to-https"
8181
# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
8282
# Cron-metrics protection (metrics:metrics for local testing).
83-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-metrics.rule=Host(`${COMPOSE_DOMAIN}`) && PathPrefix(`/cron-metrics`) "
84-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-metrics.middlewares=ITKMetricsAuth@file"
83+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}-metrics.rule=Host(`${COMPOSE_DOMAIN:?}`) && PathPrefix(`/cron-metrics`) "
84+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}-metrics.middlewares=ITKMetricsAuth@file"
8585

8686
memcached:
8787
image: memcached:alpine
@@ -107,8 +107,8 @@ services:
107107
labels:
108108
- "traefik.enable=true"
109109
- "traefik.docker.network=frontend"
110-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}mail.rule=Host(`mail-${COMPOSE_DOMAIN}`)"
111-
- "traefik.http.services.${COMPOSE_PROJECT_NAME}mail.loadbalancer.server.port=8025"
110+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}mail.rule=Host(`mail-${COMPOSE_DOMAIN:?}`)"
111+
- "traefik.http.services.${COMPOSE_PROJECT_NAME:?}mail.loadbalancer.server.port=8025"
112112

113113
# Code checks tools
114114
markdownlint:

templates/drupal-11/docker-compose.dev.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66

77
nginx:
88
labels:
9-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=ITKBasicAuth@file"
9+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}.middlewares=ITKBasicAuth@file"
1010

1111
mail:
1212
image: axllent/mailpit
@@ -17,11 +17,11 @@ services:
1717
labels:
1818
- "traefik.enable=true"
1919
- "traefik.docker.network=frontend"
20-
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}-http.rule=Host(`mail.${COMPOSE_SERVER_DOMAIN}`)"
21-
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}-http.entrypoints=web"
22-
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}-http.middlewares=redirect-to-https"
20+
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME:?}-http.rule=Host(`mail.${COMPOSE_SERVER_DOMAIN:?}`)"
21+
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME:?}-http.entrypoints=web"
22+
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME:?}-http.middlewares=redirect-to-https"
2323
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
24-
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}.rule=Host(`mail.${COMPOSE_SERVER_DOMAIN}`)"
25-
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}.entrypoints=websecure"
26-
- "traefik.http.services.mail_${COMPOSE_PROJECT_NAME}.loadbalancer.server.port=8025"
27-
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}.middlewares=ITKMailhogAuth@file"
24+
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME:?}.rule=Host(`mail.${COMPOSE_SERVER_DOMAIN:?}`)"
25+
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME:?}.entrypoints=websecure"
26+
- "traefik.http.services.mail_${COMPOSE_PROJECT_NAME:?}.loadbalancer.server.port=8025"
27+
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME:?}.middlewares=ITKMailhogAuth@file"

templates/drupal-11/docker-compose.redirect.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ services:
33
nginx:
44
labels:
55
# Add www before domain and set redirect to non-www
6-
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME}-http.rule=Host(`www.${COMPOSE_SERVER_DOMAIN}`)"
7-
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME}-http.entrypoints=web"
8-
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME}-http.middlewares=redirect-to-https,non_www"
9-
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME}.rule=Host(`www.${COMPOSE_SERVER_DOMAIN}`)"
10-
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME}.entrypoints=websecure"
11-
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME}.middlewares=non_www"
6+
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME:?}-http.rule=Host(`www.${COMPOSE_SERVER_DOMAIN:?}`)"
7+
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME:?}-http.entrypoints=web"
8+
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME:?}-http.middlewares=redirect-to-https,non_www"
9+
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME:?}.rule=Host(`www.${COMPOSE_SERVER_DOMAIN:?}`)"
10+
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME:?}.entrypoints=websecure"
11+
- "traefik.http.routers.www_${COMPOSE_PROJECT_NAME:?}.middlewares=non_www"
1212

1313
- traefik.http.middlewares.non_www.redirectregex.regex=^(http|https)?://(?:www\.)?(.+)
14-
- traefik.http.middlewares.non_www.redirectregex.replacement=https://$${2}
14+
- traefik.http.middlewares.non_www.redirectregex.replacement=https://$${2:?}
1515
- traefik.http.middlewares.non_www.redirectregex.permanent=true

templates/drupal-11/docker-compose.server.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ services:
1818
- PHP_MAX_EXECUTION_TIME=30
1919
- PHP_MEMORY_LIMIT=128M
2020
# Let drush know the site uri (makes using --uri redundant)
21-
- DRUSH_OPTIONS_URI=https://${COMPOSE_SERVER_DOMAIN}
21+
- DRUSH_OPTIONS_URI=https://${COMPOSE_SERVER_DOMAIN:?}
2222
depends_on:
2323
- memcached
2424
volumes:
@@ -37,23 +37,23 @@ services:
3737
- ./.docker/nginx.conf:/etc/nginx/nginx.conf:ro
3838
- .:/app
3939
environment:
40-
NGINX_FPM_SERVICE: ${COMPOSE_PROJECT_NAME}-phpfpm-1:9000
41-
NGINX_CRON_METRICS: ${COMPOSE_PROJECT_NAME}-phpfpm-1:9746
40+
NGINX_FPM_SERVICE: ${COMPOSE_PROJECT_NAME:?}-phpfpm-1:9000
41+
NGINX_CRON_METRICS: ${COMPOSE_PROJECT_NAME:?}-phpfpm-1:9746
4242
NGINX_WEB_ROOT: /app/web
4343
NGINX_PORT: 8080
4444
NGINX_MAX_BODY_SIZE: 5M
4545
labels:
4646
- "traefik.enable=true"
4747
- "traefik.docker.network=frontend"
48-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-http.rule=Host(`${COMPOSE_SERVER_DOMAIN}`)"
49-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-http.entrypoints=web"
50-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-http.middlewares=redirect-to-https"
48+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}-http.rule=Host(`${COMPOSE_SERVER_DOMAIN:?}`)"
49+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}-http.entrypoints=web"
50+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}-http.middlewares=redirect-to-https"
5151
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
52-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_SERVER_DOMAIN}`)"
53-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure"
52+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}.rule=Host(`${COMPOSE_SERVER_DOMAIN:?}`)"
53+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}.entrypoints=websecure"
5454
# Cron-metrics protection.
55-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-metrics.rule=Host(`${COMPOSE_DOMAIN}`) && PathPrefix(`/cron-metrics`) "
56-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-metrics.middlewares=ITKMetricsAuth@file"
55+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}-metrics.rule=Host(`${COMPOSE_DOMAIN:?}`) && PathPrefix(`/cron-metrics`) "
56+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}-metrics.middlewares=ITKMetricsAuth@file"
5757

5858
memcached:
5959
image: memcached:alpine

templates/drupal-11/docker-compose.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ services:
3939
- PHP_MEMORY_LIMIT=256M
4040
# Depending on the setup, you may have to remove --read-envelope-from from msmtp (cf. https://marlam.de/msmtp/msmtp.html) or use SMTP to send mail
4141
- PHP_SENDMAIL_PATH=/usr/bin/msmtp --host=mail --port=1025 --read-recipients --read-envelope-from
42-
- DOCKER_HOST_DOMAIN=${COMPOSE_DOMAIN}
42+
- DOCKER_HOST_DOMAIN=${COMPOSE_DOMAIN:?}
4343
- PHP_IDE_CONFIG=serverName=localhost
4444
# Let drush know the site uri (makes using --uri redundant)
45-
- DRUSH_OPTIONS_URI=http://${COMPOSE_DOMAIN}
45+
- DRUSH_OPTIONS_URI=http://${COMPOSE_DOMAIN:?}
4646
depends_on:
4747
mariadb:
4848
condition: service_healthy
@@ -64,21 +64,21 @@ services:
6464
- ./.docker/templates:/etc/nginx/templates:ro
6565
- .:/app
6666
environment:
67-
NGINX_FPM_SERVICE: ${COMPOSE_PROJECT_NAME}-phpfpm-1:9000
68-
NGINX_CRON_METRICS: ${COMPOSE_PROJECT_NAME}-phpfpm-1:9746
67+
NGINX_FPM_SERVICE: ${COMPOSE_PROJECT_NAME:?}-phpfpm-1:9000
68+
NGINX_CRON_METRICS: ${COMPOSE_PROJECT_NAME:?}-phpfpm-1:9746
6969
NGINX_WEB_ROOT: /app/web
7070
NGINX_PORT: 8080
7171
NGINX_MAX_BODY_SIZE: 5M
7272
labels:
7373
- "traefik.enable=true"
7474
- "traefik.docker.network=frontend"
75-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_DOMAIN}`)"
75+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}.rule=Host(`${COMPOSE_DOMAIN:?}`)"
7676
# HTTPS config - enable redirect from :80 to :443
77-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=redirect-to-https"
77+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}.middlewares=redirect-to-https"
7878
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
7979
# Cron-metrics protection.
80-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-metrics.rule=Host(`${COMPOSE_DOMAIN}`) && PathPrefix(`/cron-metrics`) "
81-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-metrics.middlewares=ITKMetricsAuth@file"
80+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}-metrics.rule=Host(`${COMPOSE_DOMAIN:?}`) && PathPrefix(`/cron-metrics`) "
81+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}-metrics.middlewares=ITKMetricsAuth@file"
8282

8383
memcached:
8484
image: memcached:alpine
@@ -104,8 +104,8 @@ services:
104104
labels:
105105
- "traefik.enable=true"
106106
- "traefik.docker.network=frontend"
107-
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}mail.rule=Host(`mail-${COMPOSE_DOMAIN}`)"
108-
- "traefik.http.services.${COMPOSE_PROJECT_NAME}mail.loadbalancer.server.port=8025"
107+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME:?}mail.rule=Host(`mail-${COMPOSE_DOMAIN:?}`)"
108+
- "traefik.http.services.${COMPOSE_PROJECT_NAME:?}mail.loadbalancer.server.port=8025"
109109

110110
# Code checks tools
111111
markdownlint:

0 commit comments

Comments
 (0)