# 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}" ENV TIMEOUT_KEEP_ALIVE=5 MALLOC_TRIM_THRESHOLD_=65536 CMD ["sh", "-c", "access_log_arg=--no-access-log; if [ \"${APP_ENV:-development}\" != \"production\" ] || [ \"${ACCESS_LOG:-false}\" = \"true\" ]; then access_log_arg=--access-log; fi; exec uvicorn main:app --host \"$HOST\" --port \"$PORT\" --workers \"$WORKERS\" --log-level \"$LOG_LEVEL\" \"$access_log_arg\" --timeout-keep-alive \"${TIMEOUT_KEEP_ALIVE:-5}\" --proxy-headers --forwarded-allow-ips \"${FORWARDED_ALLOW_IPS:-}\""]