From db1467f58304cbd02f06d7f739497d4e70fbcc19 Mon Sep 17 00:00:00 2001 From: Josephine de Bruijne Date: Fri, 9 Jan 2026 11:05:10 +0100 Subject: [PATCH] LPD-18031: Add documentation because we migrate from *.localhost to *.test As we're updating our development environment to Ubuntu 24.04, the *.localhost domains are resolved differently, which caused oAuth to break. To solve this, we migrate our local domains to *.test. Also removed the instructions for Mac as we don't want to support development on Mac anymore. --- .github/workflows/test.yaml | 4 ++-- README.md | 12 +++++------ docs/dns.md | 40 +++++++------------------------------ 3 files changed, 15 insertions(+), 41 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d187f37..2ed43f5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -9,8 +9,8 @@ jobs: uses: actions/checkout@v4 - name: Update Hosts file run: sudo sed -i '/^127.0.0.1/ s/$/ test.localhost/' /etc/hosts - - run: docker-compose up -d - - run: docker-compose -f tests/docker-compose.yml up -d + - run: docker compose up -d + - run: docker compose -f tests/docker-compose.yml up -d - run: sleep 1 - run: curl --fail --output test.html http://test.localhost - run: grep 'Hello world!' test.html diff --git a/README.md b/README.md index f947e5b..cf6a3f5 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The Docker Compose file in this repository contains an instance of [Traefik](https://traefik.io/) for development purposes. It allows you to access microservices through your browser using a hostname (such as -`accounts.leviy.localhost`) and to run multiple microservices at the same time +`accounts.leviy.test`) and to run multiple microservices at the same time without port binding conflicts. ## Getting started @@ -16,14 +16,14 @@ without port binding conflicts. - [Docker](https://docs.docker.com/install/) - [Docker Compose](https://docs.docker.com/compose/) -- A DNS resolver that resolves any hostname ending in ".localhost" to 127.0.0.1 (see [instructions](docs/dns.md)) +- A DNS resolver that resolves any hostname ending in ".test" to 127.0.0.1 (see [instructions](docs/dns.md)) ### Installation ```bash git clone git@github.com:leviy/workspace.git cd workspace -docker-compose up -d +docker compose up -d ``` The Docker Compose file contains the `restart: always` directive so Docker will @@ -32,7 +32,7 @@ need to start another container or project that needs to bind to port 80, you can stop the containers using: ```bash -docker-compose stop +docker compose stop ``` ### Usage @@ -51,7 +51,7 @@ services: - workspace - default labels: - traefik.frontend.rule: Host:subdomain.leviy.localhost + traefik.frontend.rule: Host:subdomain.leviy.test traefik.enable: 'true' networks: @@ -67,5 +67,5 @@ Non-web services (such as databases, etc.) should only be linked to the When started, Traefik will automatically detect this service and start routing traffic to it. -To see it in action simply open `http://subdomain.leviy.localhost` in a +To see it in action simply open `http://subdomain.leviy.test` in a browser. diff --git a/docs/dns.md b/docs/dns.md index fb15b1a..ed09426 100644 --- a/docs/dns.md +++ b/docs/dns.md @@ -8,41 +8,15 @@ host you need to configure your DNS to resolve all hostnames ending on ## Linux (Ubuntu) -On Ubuntu 18.04 no action is required, because [systemd-resolved](https://manpages.ubuntu.com/manpages/bionic/man8/systemd-resolved.service.8.html) -already resolves hostnames ending on ".localhost" to 127.0.0.1 and ::1. +On Ubuntu 20.04 you have to manually add lines to the /etc/hosts file for all domains that +you want to resolve locally: -If for some reason resolving is not working on Ubuntu, make sure that the -symlink `/etc/resolv.conf` is pointing to `/run/systemd/resolve/stub-resolv.conf`: - -```bash -ll /etc/resolv.conf ``` - -If this doesn't point to `/run/systemd/resolve/stub-resolv.conf`, overwrite the -symbolic link: - -```bash -sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf +127.0.0.1 dashboard.leviy.test +127.0.0.1 files.leviy.test +127.0.0.1 accounts.leviy.test ``` -## macOS High Sierra - -On macOS the same can be achieved by installing dnsmasq and configuring it to -route all traffic for ".localhost" to 127.0.0.1: - -```bash -brew install dnsmasq - -mkdir -pv $(brew --prefix)/etc/ -echo 'address=/.localhost/127.0.0.1' >> $(brew --prefix)/etc/dnsmasq.conf -echo 'port=53' >> $(brew --prefix)/etc/dnsmasq.conf - -sudo brew services start dnsmasq - -sudo mkdir -v /etc/resolver -sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/localhost' - -ping dashboard.leviy.localhost -``` +On Ubuntu 24.04 you can use the `systemd-resolve` to resolve all domains ending on ".test" to 127.0.0.1. -[Source](https://medium.com/@kharysharpe/automatic-local-domains-setting-up-dnsmasq-for-macos-high-sierra-using-homebrew-caf767157e43) +(work in progress, will add additional instructions as soon as we updated to Ubuntu 24.04)