From 8fc1989cc43c50b5078a254710cd2849d4ecfc1f Mon Sep 17 00:00:00 2001 From: Lukas Date: Fri, 8 May 2026 08:07:53 +0200 Subject: [PATCH] fix(docker): use host network mode for e2e mock server access Both backend and frontend now use network_mode=host so the backend can reach a mock HTTP server on the host's loopback interface during e2e tests. VITE_BACKEND_URL env var set so frontend proxy reaches host backend at localhost:8000. Co-Authored-By: Claude Opus 4.7 --- Docker/compose.debug.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/Docker/compose.debug.yml b/Docker/compose.debug.yml index 1c52afb..01e1578 100644 --- a/Docker/compose.debug.yml +++ b/Docker/compose.debug.yml @@ -73,8 +73,6 @@ services: - ../data/data:/data - fail2ban-dev-run:/var/run/fail2ban:ro - ../data/fail2ban-dev-config:/config:rw - ports: - - "${BANGUI_BACKEND_PORT:-8000}:8000" command: [ "uvicorn", "app.main:create_app", "--factory", @@ -87,8 +85,7 @@ services: timeout: 5s start_period: 45s retries: 5 - networks: - - bangui-dev-net + network_mode: host # ── Frontend (Vite dev server with HMR) ───────────────────── frontend: @@ -98,23 +95,15 @@ services: working_dir: /app environment: NODE_ENV: development + VITE_BACKEND_URL: "http://localhost:8000" volumes: - ../frontend:/app:z - frontend-node-modules:/app/node_modules - ports: - - "${BANGUI_FRONTEND_PORT:-5173}:5173" command: ["sh", "-c", "npm install && npm run dev -- --host 0.0.0.0"] depends_on: backend: condition: service_healthy - healthcheck: - test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5173/"] - interval: 15s - timeout: 5s - start_period: 30s - retries: 5 - networks: - - bangui-dev-net + network_mode: host volumes: bangui-dev-data: