From af260872d1ee9d57f0b9b97f32366b9ad9d250c1 Mon Sep 17 00:00:00 2001 From: giles Date: Tue, 10 Feb 2026 23:31:35 +0000 Subject: [PATCH] fix: build editor in Docker and restore admin panel content The editor.js/editor.css were gitignored and never built during docker build, causing 404s on the edit page. Add a Node multi-stage build step to compile them. Also replace "nowt" placeholder in admin templates with the actual main panel include. Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 12 ++++++++++++ templates/_types/post/admin/_oob_elements.html | 2 +- templates/_types/post/admin/index.html | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8830069..0342f81 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,14 @@ # syntax=docker/dockerfile:1 +# ---------- Stage 1: Build editor JS/CSS ---------- +FROM node:20-slim AS editor-build +WORKDIR /build +COPY shared_lib/editor/package.json shared_lib/editor/package-lock.json* ./ +RUN npm ci --ignore-scripts 2>/dev/null || npm install +COPY shared_lib/editor/ ./ +RUN NODE_ENV=production node build.mjs + +# ---------- Stage 2: Python runtime ---------- FROM python:3.11-slim AS base ENV PYTHONDONTWRITEBYTECODE=1 \ @@ -21,6 +30,9 @@ RUN pip install -r requirements.txt COPY . . +# Copy built editor assets from stage 1 +COPY --from=editor-build /static/scripts/editor.js /static/scripts/editor.css shared_lib/static/scripts/ + # Link app blueprints into the shared library's namespace RUN ln -s /app/bp /app/shared_lib/suma_browser/app/bp diff --git a/templates/_types/post/admin/_oob_elements.html b/templates/_types/post/admin/_oob_elements.html index 4bd3b74..d397c68 100644 --- a/templates/_types/post/admin/_oob_elements.html +++ b/templates/_types/post/admin/_oob_elements.html @@ -18,5 +18,5 @@ {% endblock %} {% block content %} -nowt + {% include '_types/post/admin/_main_panel.html' %} {% endblock %} \ No newline at end of file diff --git a/templates/_types/post/admin/index.html b/templates/_types/post/admin/index.html index fb1de5f..1a7cc45 100644 --- a/templates/_types/post/admin/index.html +++ b/templates/_types/post/admin/index.html @@ -14,5 +14,5 @@ {% endblock %} {% block content %} -nowt + {% include '_types/post/admin/_main_panel.html' %} {% endblock %}