refactor(docker): simplify to single compose + dynamic build default

This commit is contained in:
rbetree
2026-02-20 00:52:23 +08:00
parent b2aeb0b355
commit f45df870d7
5 changed files with 98 additions and 66 deletions

View File

@@ -0,0 +1,25 @@
#!/bin/sh
set -eu
echo "[menav] starting dynamic build mode"
if [ "${MENAV_IMPORT_BOOKMARKS:-false}" = "true" ]; then
echo "[menav] importing bookmarks before build"
MENAV_BOOKMARKS_DETERMINISTIC=1 npm run import-bookmarks
fi
if [ "${MENAV_ENABLE_SYNC:-false}" = "true" ]; then
echo "[menav] building with sync enabled"
npm run build
else
echo "[menav] building with sync disabled"
PROJECTS_ENABLED=false HEATMAP_ENABLED=false RSS_ENABLED=false npm run build
fi
echo "[menav] syncing dist to nginx web root"
mkdir -p /usr/share/nginx/html
rm -rf /usr/share/nginx/html/*
cp -a /app/dist/. /usr/share/nginx/html/
echo "[menav] serving dist with nginx"
exec nginx -g 'daemon off;'