From 8a8c5481333ec6f9181187904c9d21f265c0856a Mon Sep 17 00:00:00 2001 From: Johan Bloemberg Date: Thu, 30 May 2024 10:35:58 +0200 Subject: [PATCH] Fix merging of networks in compose config files for Docker Compose 24+ --- Makefile | 4 ++++ docker/docker-compose-integration-tests.yml | 3 ++- documentation/Docker-development-environment.md | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d35b0b56f..40246b25a 100644 --- a/Makefile +++ b/Makefile @@ -470,6 +470,10 @@ run-shell: cmd=/bin/bash run-shell: ${DOCKER_COMPOSE_UP_PULL_CMD} run ${run_args} --entrypoint ${cmd} ${service} +# show result of merging .yml docker compose config files +docker-compose-config: + ${DOCKER_COMPOSE_UP_PULL_CMD} config + docker-compose-create-superuser: ${DOCKER_COMPOSE_CMD} exec app ./manage.py shell -c "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@example.com', 'admin')" diff --git a/docker/docker-compose-integration-tests.yml b/docker/docker-compose-integration-tests.yml index c6398bc8a..e8c0a9ae5 100644 --- a/docker/docker-compose-integration-tests.yml +++ b/docker/docker-compose-integration-tests.yml @@ -189,9 +189,10 @@ networks: internal: false driver: bridge - public-internet: + public-internet: !override # make public network internal as well to run tests isolated from the internet internal: true + # required to enable IPv6 on Docker Desktop runtime enable_ipv6: true driver: bridge diff --git a/documentation/Docker-development-environment.md b/documentation/Docker-development-environment.md index c2e14876a..9814a323f 100644 --- a/documentation/Docker-development-environment.md +++ b/documentation/Docker-development-environment.md @@ -343,6 +343,12 @@ It is also possible to enter the container used for the tests and run pytest dir For more information about how to invoke the test command see: [Integration Tests#tips-and-tricks](https://github.com/internetstandards/Internet.nl/blob/docker/documentation/Docker-integration-tests.md#tips-and-tricks) +### Docker compose configuration files + +Newer versions of Docker Compose may have different ways of processing configuration files or the way they are merged. To see what the final configuration file looks like after merging for example `docker-compose.yml` and `docker-compose-intergration-test.yml` for the `test` environment run: + + make docker-compose-config env=test + ## Metrics (grafana/prometheus) The development environment includes the same metrics collection as used on the production environment. It consists of a Prometheus metrics server with various exporters and a Grafana frontend. To view metrics and graphs visit: `http://localhost:8080/grafana/` with user and password being `test`.