Fix container npm install race with flock lock
This commit is contained in:
@@ -3,6 +3,11 @@ set -euo pipefail
|
|||||||
|
|
||||||
cd "$(dirname "$0")/.."
|
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.
|
# 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.
|
# If any cache contains absolute /Users/... imports, Nitro dev runtime can break in /app.
|
||||||
mkdir -p .nuxt .output
|
mkdir -p .nuxt .output
|
||||||
|
|||||||
@@ -3,6 +3,11 @@ set -euo pipefail
|
|||||||
|
|
||||||
cd "$(dirname "$0")/.."
|
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.
|
# Worker container starts from clean image.
|
||||||
# Install deps without frontend postinstall hooks (nuxt prepare) to keep worker lean/stable.
|
# Install deps without frontend postinstall hooks (nuxt prepare) to keep worker lean/stable.
|
||||||
npm install --ignore-scripts
|
npm install --ignore-scripts
|
||||||
|
|||||||
Reference in New Issue
Block a user