19 lines
471 B
Bash
19 lines
471 B
Bash
#!/bin/sh
|
|
|
|
# If /opt/app/package.json does not exist, copy the app skeleton into /opt/app
|
|
if [ ! -f /opt/app/package.json ]; then
|
|
echo "Initializing /opt/app with application files..."
|
|
cp -R /opt/app-template/* /opt/app/
|
|
cp -R /opt/app-template/.[!.]* /opt/app/ 2>/dev/null || true
|
|
fi
|
|
|
|
cd /opt/app
|
|
|
|
# If node_modules is missing, install dependencies
|
|
if [ ! -d node_modules ]; then
|
|
echo "node_modules not found, running npm ci..."
|
|
npm ci
|
|
fi
|
|
|
|
exec "$@"
|