diff --git a/.docker/scripts/proxy/services.sh b/.docker/scripts/proxy/services.sh index 4a7724e..ed00d15 100644 --- a/.docker/scripts/proxy/services.sh +++ b/.docker/scripts/proxy/services.sh @@ -20,7 +20,8 @@ connect_proxy_to_project_network() { return 0 fi - Docker network connect "$network" "$proxy_container" + public_host="${NEXTCLOUD_HOST:-${PROJECT_NAME:-}.localhost}" + Docker network connect --alias "$public_host" "$network" "$proxy_container" } disconnect_proxy_from_project_network() { diff --git a/docker-compose.yml b/docker-compose.yml index 60673b1..131043b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -132,8 +132,6 @@ services: command: sleep infinity depends_on: - nextcloud - extra_hosts: - - "${NEXTCLOUD_HOST:-${COMPOSE_PROJECT_NAME}.localhost}:host-gateway" restart: unless-stopped networks: - default diff --git a/tests/proxy/services.bats b/tests/proxy/services.bats index 9a02fb7..0c1c28c 100644 --- a/tests/proxy/services.bats +++ b/tests/proxy/services.bats @@ -11,9 +11,10 @@ setup() { source "$REPO_ROOT/.docker/scripts/proxy/services.sh" PROJECT_NAME=current + NEXTCLOUD_HOST=current.localhost } -@test "proxy is connected to the current Compose project network" { +@test "proxy is connected to the current Compose project network with the public hostname alias" { compatible_proxy_container() { printf '%s\n' librecode-dev-proxy; } container_networks() { printf '{}\n'; } Docker() { @@ -22,7 +23,7 @@ setup() { connect_proxy_to_project_network - grep -q '^docker network connect current_default librecode-dev-proxy$' "$TEST_LOG" + grep -q '^docker network connect --alias current.localhost current_default librecode-dev-proxy$' "$TEST_LOG" } @test "proxy is not connected twice to the project network" { diff --git a/tests/worker/contract.bats b/tests/worker/contract.bats index a8123e3..351d354 100644 --- a/tests/worker/contract.bats +++ b/tests/worker/contract.bats @@ -113,11 +113,3 @@ setup() { } - -@test "Playwright resolves the public Nextcloud hostname through the Docker host" { - run env DB_TYPE=sqlite COMPOSE_PROFILES=playwright sh "$WORKER" playwright-route config - [ "$status" -eq 0 ] - [[ "$output" == *"PLAYWRIGHT_BASE_URL: https://ncdev-playwright-route.localhost"* ]] - [[ "$output" == *"ncdev-playwright-route.localhost"* ]] - [[ "$output" == *"host-gateway"* ]] -}