Fix container npm install race with flock lock

This commit is contained in:
Ruslan Bakiev
2026-02-19 17:46:59 +07:00
parent 895867d710
commit ed348a7ec4
2 changed files with 10 additions and 0 deletions

View File

@@ -3,6 +3,11 @@ set -euo pipefail
cd "$(dirname "$0")/.."
# Serialize dependency install when multiple containers share the same workspace.
LOCK_FILE=/tmp/clientsflow-npm-install.lock
exec 9>"$LOCK_FILE"
flock 9
# Prevent path leakage between host Nuxt build cache and Docker runtime.
# If any cache contains absolute /Users/... imports, Nitro dev runtime can break in /app.
mkdir -p .nuxt .output

View File

@@ -3,6 +3,11 @@ set -euo pipefail
cd "$(dirname "$0")/.."
# Serialize dependency install when multiple containers share the same workspace.
LOCK_FILE=/tmp/clientsflow-npm-install.lock
exec 9>"$LOCK_FILE"
flock 9
# Worker container starts from clean image.
# Install deps without frontend postinstall hooks (nuxt prepare) to keep worker lean/stable.
npm install --ignore-scripts