From bebf0a3f2f629fbc70538d197c2789fd039a5207 Mon Sep 17 00:00:00 2001 From: Thomas Fini Hansen Date: Fri, 20 Dec 2024 11:41:35 +0100 Subject: [PATCH 1/2] Eliminate docker-compose.dev.yml We can tell Lagoon to ignore the `https` service with a label, so we don't need a separate file. --- Taskfile.yml | 3 --- docker-compose.dev.yml | 24 ------------------------ docker-compose.yml | 22 ++++++++++++++++++++++ 3 files changed, 22 insertions(+), 27 deletions(-) delete mode 100644 docker-compose.dev.yml diff --git a/Taskfile.yml b/Taskfile.yml index 1f343973c..98b63e74b 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -34,7 +34,6 @@ vars: DOCKER_COMPOSE_FILES_DEFAULT: "-f docker-compose.yml" DOCKER_COMPOSE_FILES: "{{.DOCKER_COMPOSE_FILES | default .DOCKER_COMPOSE_FILES_DEFAULT }}" DOCKER_COMPOSE_FILES_CI: "{{.DOCKER_COMPOSE_FILES}} -f docker-compose.ci.yml" - DOCKER_COMPOSE_FILES_DEV: "{{.DOCKER_COMPOSE_FILES}} -f docker-compose.dev.yml" # Sql dump files directory DIR_RESTORE_DATABASE: "restore/database" @@ -178,8 +177,6 @@ tasks: - task dev:create-users # Show a one-time login to the local site. - task dev:cli -- drush user-login - env: - DOCKER_COMPOSE_FILES: "{{ .DOCKER_COMPOSE_FILES_DEV }}" dev:openid:configure: desc: Set openid connect settings based on .env variables. And run cron. diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml deleted file mode 100644 index cbbad7034..000000000 --- a/docker-compose.dev.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -services: - https: - image: ghcr.io/reload/https-proxy:proxy - ports: - - '80' - - '443' - depends_on: - - varnish - volumes: - - 'projectroot:/app' - - '${HOME}/.local/share/mkcert:/rootCA:ro' - - '${HOME}/.local/share/dev_certificates:/cert:rw' - environment: - NGINX_DOCUMENT_ROOT: /app/web - NGINX_PROXY_PASS: http://varnish:8080 - VIRTUAL_PROTO: https - VIRTUAL_HOST: >- - ${COMPOSE_PROJECT_NAME:-dapple-cms}.${DEV_TLD:-docker} - working_dir: /app - - varnish: - labels: - - dev.orbstack.domains=${COMPOSE_PROJECT_NAME:-dapple-cms}.local diff --git a/docker-compose.yml b/docker-compose.yml index 6d3e29e6c..eea1763a8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,6 +38,27 @@ x-environment: #LAGOON_ENVIRONMENT_TYPE: production services: + https: + image: ghcr.io/reload/https-proxy:proxy + ports: + - '80' + - '443' + depends_on: + - varnish + labels: + lagoon.type: none + volumes: + - 'projectroot:/app' + - '${HOME}/.local/share/mkcert:/rootCA:ro' + - '${HOME}/.local/share/dev_certificates:/cert:rw' + environment: + NGINX_DOCUMENT_ROOT: /app/web + NGINX_PROXY_PASS: http://varnish:8080 + VIRTUAL_PROTO: https + VIRTUAL_HOST: >- + ${COMPOSE_PROJECT_NAME:-dapple-cms}.${DEV_TLD:-docker} + working_dir: /app + varnish: # Caching HTTP reverse proxy that serves (mostly) anonymous requests. # https://docs.lagoon.sh/lagoon/docker-images/varnish image: uselagoon/varnish-6-drupal:latest @@ -45,6 +66,7 @@ services: - nginx labels: lagoon.type: varnish + dev.orbstack.domains: ${COMPOSE_PROJECT_NAME:-dapple-cms}.local links: - nginx # links varnish to the nginx in this docker-compose project, or it would try to connect to any nginx running in docker << : *default-user # uses the defined user from top From 4aa11b4e6a9edeeeff08e77f6b2e163d3688f80f Mon Sep 17 00:00:00 2001 From: Thomas Fini Hansen Date: Fri, 20 Dec 2024 11:43:21 +0100 Subject: [PATCH 2/2] Don't default COMPOSE_PROJECT_NAME in docker-compose.yml If you run a docker compose old enough to not define COMPOSE_PROJECT_NAME, you're going to run into a whole lot of other problems anyway. --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index eea1763a8..e6d475f52 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -56,7 +56,7 @@ services: NGINX_PROXY_PASS: http://varnish:8080 VIRTUAL_PROTO: https VIRTUAL_HOST: >- - ${COMPOSE_PROJECT_NAME:-dapple-cms}.${DEV_TLD:-docker} + ${COMPOSE_PROJECT_NAME}.${DEV_TLD:-docker} working_dir: /app varnish: # Caching HTTP reverse proxy that serves (mostly) anonymous requests. @@ -66,7 +66,7 @@ services: - nginx labels: lagoon.type: varnish - dev.orbstack.domains: ${COMPOSE_PROJECT_NAME:-dapple-cms}.local + dev.orbstack.domains: ${COMPOSE_PROJECT_NAME}.local links: - nginx # links varnish to the nginx in this docker-compose project, or it would try to connect to any nginx running in docker << : *default-user # uses the defined user from top