fix: build editor in Docker and restore admin panel content
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 49s
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:
12
Dockerfile
12
Dockerfile
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -18,5 +18,5 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
nowt
|
{% include '_types/post/admin/_main_panel.html' %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -14,5 +14,5 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
nowt
|
{% include '_types/post/admin/_main_panel.html' %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user