2
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2026-01-03 11:34:57 +01:00

fix nodebb

This commit is contained in:
kev
2016-01-16 12:07:47 +08:00
parent d852efc40a
commit 6c8b38b756
10 changed files with 110 additions and 33 deletions

View File

@@ -7,12 +7,16 @@ export daemon=false
if [[ "$*" == npm*start* ]]; then
if [ ! -e "$BB_CONTENT/config.json" ]; then
sed "s/SECRET/$(node -e 'console.log(require("node-uuid").v4())')/" \
"$BB_SOURCE/config.example.json" > "$BB_CONTENT/config.json"
npm install connect-redis
if [ -e "$BB_SOURCE/config.json" ]; then
cp "$BB_SOURCE/config.json" "$BB_CONTENT/config.json"
fi
fi
ln -sf "$BB_CONTENT/config.json" "$BB_SOURCE/config.json"
if [ -e "$BB_CONTENT/config.json" ]; then
ln -sf "$BB_CONTENT/config.json" "$BB_SOURCE/config.json"
[ -d "$BB_SOURCE/node_modules/redis" ] || npm install redis
[ -d "$BB_SOURCE/node_modules/connect-redis" ] || npm install connect-redis
fi
exec "$@"
fi