-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
executable file
·29 lines (25 loc) · 914 Bytes
/
docker-entrypoint.sh
File metadata and controls
executable file
·29 lines (25 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
set -e
# Ensure core dependencies are present in the volume.
# On first run (empty volume) or after an image update, reinstall core deps.
if [ ! -f /app/node_modules/.package-lock.json ] || \
! diff -q /app/package-lock.json /app/node_modules/.package-lock.json > /dev/null 2>&1; then
echo "[entrypoint] Installing core dependencies..."
npm ci --omit=dev
cp /app/package-lock.json /app/node_modules/.package-lock.json
fi
# Collect skill dependencies from skills/*/dependencies.txt
DEPS=""
for f in /app/skills/*/dependencies.txt; do
[ -f "$f" ] || continue
while IFS= read -r line || [ -n "$line" ]; do
# Strip comments and whitespace
line=$(echo "$line" | sed 's/#.*//' | xargs)
[ -n "$line" ] && DEPS="$DEPS $line"
done < "$f"
done
if [ -n "$DEPS" ]; then
echo "[entrypoint] Installing skill dependencies:$DEPS"
npm install --no-save $DEPS
fi
exec node dist/index.js