31 lines
1.3 KiB
Docker
31 lines
1.3 KiB
Docker
# Build the exact reviewed 2026 frontend while preserving the existing legacy themes.
|
|
ARG BASE_IMAGE
|
|
FROM --platform=$BUILDPLATFORM node:22-alpine AS frontend
|
|
ARG FRONTEND_2026_REPO=https://git.orionc.me/orion/FileCodeBoxFronted2026.git
|
|
ARG FRONTEND_2026_REF
|
|
RUN apk add --no-cache git && corepack enable && corepack prepare pnpm@9.15.9 --activate
|
|
WORKDIR /build
|
|
RUN test -n "$FRONTEND_2026_REF" && \
|
|
git init . && git remote add origin "$FRONTEND_2026_REPO" && \
|
|
git fetch --depth 1 origin "$FRONTEND_2026_REF" && git checkout --detach FETCH_HEAD && \
|
|
test "$(git rev-parse HEAD)" = "$FRONTEND_2026_REF" && \
|
|
pnpm install --frozen-lockfile --prod=false && \
|
|
node --experimental-strip-types --test --experimental-test-coverage tests/*.test.mjs && \
|
|
pnpm run build
|
|
|
|
FROM ${BASE_IMAGE}
|
|
ARG APP_VERSION
|
|
ARG VCS_REF
|
|
ARG FRONTEND_2026_REF
|
|
LABEL org.opencontainers.image.version="${APP_VERSION}"
|
|
LABEL org.opencontainers.image.revision="${VCS_REF}"
|
|
LABEL org.opencontainers.image.filecodebox.frontend-2026-revision="${FRONTEND_2026_REF}"
|
|
WORKDIR /app
|
|
COPY VERSION requirements.txt main.py ./
|
|
COPY apps ./apps
|
|
COPY core ./core
|
|
COPY scripts ./scripts
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
COPY --from=frontend /build/dist ./themes/2026
|
|
ENV APP_VERSION="${APP_VERSION}"
|