Enhance course management by adding 'featured' and 'sort_order' fields to the database schema and related components. Update course filtering and display logic to prioritize featured courses in the catalog. Modify admin interfaces for course creation and editing to include new fields, ensuring proper handling in both the frontend and backend. Update documentation to reflect these changes.
This commit is contained in:
1 parent
1641edfd01
commit
4b84409ed7
43 files changed
+703
-155
No files matched your search
@@ -13,14 +13,23 @@ export NODE_OPTIONS="${NODE_OPTIONS:---max-old-space-size=3072}"
|
||||
|
||||
echo "Building Next.js at $ROOT (Node 22 container)…"
|
||||
# No BuildKit cache mounts — stock docker on the VPS does not support type=cache.
|
||||
# A normal host directory works. .next/cache stays on the checkout between deploys
|
||||
# so webpack can reuse it. Do not delete it here.
|
||||
NPM_CACHE=/var/cache/edu-npm
|
||||
if ! mkdir -p "$NPM_CACHE" 2>/dev/null; then
|
||||
NPM_CACHE="$ROOT/.npm-cache"
|
||||
mkdir -p "$NPM_CACHE"
|
||||
fi
|
||||
docker run --rm \
|
||||
-e DISABLE_REACT_COMPILER=1 \
|
||||
-e NEXT_TELEMETRY_DISABLED=1 \
|
||||
-e NEXT_PUBLIC_SITE_URL \
|
||||
-e NODE_OPTIONS \
|
||||
-e SKIP_TYPECHECK=1 \
|
||||
-v "$ROOT:/app" -w /app \
|
||||
-v "$NPM_CACHE:/root/.npm" \
|
||||
node:22-alpine \
|
||||
sh -ec 'npm ci --no-audit --no-fund && npm run build'
|
||||
sh /app/scripts/vps-next-build.sh
|
||||
|
||||
bash scripts/assemble-prebuilt.sh "$ROOT/prebuilt"
|
||||
rm -rf "$ROOT/prebuilt/static"
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
# Runs inside node:22-alpine with the repo mounted at /app.
|
||||
# npm cache is a host directory mounted at /root/.npm (BuildKit cache mounts
|
||||
# are unavailable on the VPS Docker).
|
||||
set -eu
|
||||
cd /app
|
||||
|
||||
lock=$(sha256sum package-lock.json | awk 'NR==1 { print $1 }')
|
||||
node_ver=$(node -v)
|
||||
stamp="node_modules/.install-stamp"
|
||||
want="$lock $node_ver"
|
||||
|
||||
if [ -d node_modules/next ] && [ -f "$stamp" ] && [ "$(cat "$stamp")" = "$want" ]; then
|
||||
echo "Dependencies unchanged ($node_ver); skipping npm ci"
|
||||
else
|
||||
echo "Installing dependencies ($node_ver)…"
|
||||
npm ci --no-audit --no-fund --prefer-offline --cache /root/.npm
|
||||
printf '%s\n' "$want" > "$stamp"
|
||||
fi
|
||||
|
||||
npm run build
|
||||
Reference in new issue
Block a user