fix: build editor in Docker and restore admin panel content
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 49s

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 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-10 23:31:35 +00:00
parent f90d0f2e21
commit af260872d1
3 changed files with 14 additions and 2 deletions

View File

@@ -1,5 +1,14 @@
# syntax=docker/dockerfile:1 # 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 FROM python:3.11-slim AS base
ENV PYTHONDONTWRITEBYTECODE=1 \ ENV PYTHONDONTWRITEBYTECODE=1 \
@@ -21,6 +30,9 @@ RUN pip install -r requirements.txt
COPY . . 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 # Link app blueprints into the shared library's namespace
RUN ln -s /app/bp /app/shared_lib/suma_browser/app/bp RUN ln -s /app/bp /app/shared_lib/suma_browser/app/bp

View File

@@ -18,5 +18,5 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
nowt {% include '_types/post/admin/_main_panel.html' %}
{% endblock %} {% endblock %}

View File

@@ -14,5 +14,5 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
nowt {% include '_types/post/admin/_main_panel.html' %}
{% endblock %} {% endblock %}