Skip to content

Commit

Permalink
Fix merging of networks in compose config files for Docker Compose 24+
Browse files Browse the repository at this point in the history
  • Loading branch information
aequitas committed May 30, 2024
1 parent 55653ab commit 8a8c548
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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')"

Expand Down
3 changes: 2 additions & 1 deletion docker/docker-compose-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions documentation/Docker-development-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down

0 comments on commit 8a8c548

Please sign in to comment.