Changeset 0.17.2 (#77)
This commit is contained in:
14
Dockerfile
14
Dockerfile
@@ -3,7 +3,8 @@
|
||||
# ============================================
|
||||
# Stage 1: Build Go backend
|
||||
# Stage 2: Download JS vendor libs (marked, DOMPurify)
|
||||
# Stage 3: Production image (nginx + backend)
|
||||
# Stage 3: Build CM6 editor bundle (esbuild)
|
||||
# Stage 4: Production image (nginx + backend)
|
||||
#
|
||||
# Vendor libs are baked in during build so the
|
||||
# app works in disconnected environments
|
||||
@@ -48,7 +49,15 @@ RUN npm pack katex@0.16.11 && \
|
||||
cp -r package/dist/fonts katex/fonts && \
|
||||
rm -rf package katex-0.16.11.tgz
|
||||
|
||||
# ── Stage 3: Production ─────────────────────
|
||||
# ── Stage 3: CM6 editor bundle ─────────────
|
||||
FROM node:20-alpine AS cm6-build
|
||||
WORKDIR /build
|
||||
COPY src/editor/ /build/src/editor/
|
||||
COPY scripts/build-editor.sh /build/scripts/build-editor.sh
|
||||
RUN cd /build/src/editor && npm ci --loglevel=warn
|
||||
RUN sh /build/scripts/build-editor.sh /build/dist
|
||||
|
||||
# ── Stage 4: Production ─────────────────────
|
||||
FROM nginx:1-alpine
|
||||
|
||||
RUN apk add --no-cache bash
|
||||
@@ -74,6 +83,7 @@ COPY --from=vendor /vendor/mermaid/mermaid.min.js /usr/share/nginx/html/vendor/m
|
||||
COPY --from=vendor /vendor/katex/katex.min.js /usr/share/nginx/html/vendor/katex/katex.min.js
|
||||
COPY --from=vendor /vendor/katex/katex.min.css /usr/share/nginx/html/vendor/katex/katex.min.css
|
||||
COPY --from=vendor /vendor/katex/fonts/ /usr/share/nginx/html/vendor/katex/fonts/
|
||||
COPY --from=cm6-build /build/dist/ /usr/share/nginx/html/vendor/codemirror/
|
||||
|
||||
# Builtin extensions (seeded into DB on startup by backend)
|
||||
COPY extensions/builtin/ /app/extensions/builtin/
|
||||
|
||||
Reference in New Issue
Block a user