me / entrypoint.sh
cheymin's picture
Create entrypoint.sh
893c5d8 verified
raw
history blame contribute delete
683 Bytes
#!/bin/sh
set -e
echo "[$(date)] Starting Menav..."
# 同步书签(如果启用)
if [ "$MENAV_IMPORT_BOOKMARKS" = "true" ] && [ -d /app/bookmarks ]; then
echo "[$(date)] Importing bookmarks..."
npm run import-bookmarks || echo "Import failed, continuing"
fi
# 同步数据(如果启用)
if [ "$MENAV_ENABLE_SYNC" = "true" ]; then
echo "[$(date)] Syncing data..."
npm run sync-all || echo "Sync failed, continuing"
fi
# 构建项目(确保最新)
echo "[$(date)] Building project..."
npm run build
# 启动 nginx 提供静态文件
echo "[$(date)] Starting nginx on port 7860..."
nginx -c /etc/nginx/nginx.conf
# 保持容器运行
tail -f /dev/null