From 1999cff6de7bc29699ccc7f7333812700b07170a Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev Date: Wed, 18 Feb 2026 23:20:17 +0700 Subject: [PATCH] Fix compose dev: isolate node_modules and remove host path leakage --- Frontend/scripts/compose-dev.sh | 4 ++-- compose.yaml | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Frontend/scripts/compose-dev.sh b/Frontend/scripts/compose-dev.sh index 0a10f7a..96751dc 100755 --- a/Frontend/scripts/compose-dev.sh +++ b/Frontend/scripts/compose-dev.sh @@ -4,8 +4,8 @@ set -euo pipefail cd "$(dirname "$0")/.." # Prevent path leakage between host Nuxt build cache and Docker runtime. -# Host-generated .nuxt can contain absolute /Users/... imports that break in /app. -rm -rf .nuxt .output +# If any cache contains absolute /Users/... imports, Nitro dev runtime can break in /app. +rm -rf .nuxt .output node_modules/.cache node_modules/.vite # Install deps (container starts from a clean image). # Fallback to npm install when lockfile was produced by a newer npm major. diff --git a/compose.yaml b/compose.yaml index 9ff7202..767bb77 100644 --- a/compose.yaml +++ b/compose.yaml @@ -3,8 +3,11 @@ services: image: node:22-bookworm-slim working_dir: /app/Frontend volumes: - - .:/app + # Mount only the app source; keep node_modules inside the container to avoid + # leaking absolute host paths into Nuxt/Nitro dev runtime. + - ./Frontend:/app/Frontend - clientsflow_data:/app/.data + - frontend_node_modules:/app/Frontend/node_modules ports: - "3000:3000" environment: @@ -12,12 +15,9 @@ services: REDIS_URL: "redis://redis:6379" CF_AGENT_MODE: "langgraph" OPENAI_MODEL: "gpt-4o-mini" - GIGACHAT_AUTH_KEY: "MDE5YzQwNmQtMDM0NC03MTVlLTg4MTAtOWZlYjlmNzQwY2E3OmNhZTg5NmM1LWZiOGEtNGZkZS04ODA0LWZkYjYyYzVlMTI0OQ==" - GIGACHAT_MODEL: "GigaChat-2" - GIGACHAT_SCOPE: "GIGACHAT_API_PERS" - NODE_TLS_REJECT_UNAUTHORIZED: "0" # Set this in your shell or a compose override: # OPENAI_API_KEY: "..." + # GIGACHAT_AUTH_KEY: "..." (if you use GigaChat integration) command: > bash -lc " ./scripts/compose-dev.sh @@ -34,4 +34,5 @@ services: volumes: clientsflow_data: + frontend_node_modules: redis_data: