feat(taxonomy): add rust sidecar compact surface pipeline

This commit is contained in:
2026-03-12 15:23:10 -04:00
parent f2c25fb9c6
commit 58061af006
84 changed files with 19350 additions and 265 deletions

View File

@@ -6,6 +6,13 @@ COPY package.json bun.lock ./
RUN --mount=type=cache,target=/root/.bun/install/cache \
bun install --frozen-lockfile
FROM rust:1.93-alpine AS rust-builder
WORKDIR /app
COPY rust ./rust
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/app/rust/target \
cargo build --manifest-path rust/Cargo.toml --release --bin fiscal-xbrl
FROM deps AS builder
ARG NEXT_PUBLIC_API_URL=
ARG DATABASE_URL=file:data/fiscal.sqlite
@@ -38,15 +45,21 @@ COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/drizzle ./drizzle
COPY --from=builder /app/scripts ./scripts
COPY --from=builder /app/lib ./lib
COPY --from=builder /app/contracts ./contracts
COPY --from=builder /app/rust/taxonomy ./rust/taxonomy
COPY --from=builder /app/tsconfig.json ./tsconfig.json
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/package.json ./package.json
COPY --from=deps /app/bun.lock ./bun.lock
COPY --from=rust-builder /app/rust/target/release/fiscal-xbrl ./bin/fiscal-xbrl
RUN mkdir -p /app/data /app/.workflow-data
RUN mkdir -p /app/data /app/.workflow-data /app/bin /app/.cache/xbrl && chmod +x /app/bin/fiscal-xbrl
EXPOSE 3000
ENV PORT=3000
ENV FISCAL_XBRL_BIN=/app/bin/fiscal-xbrl
ENV FISCAL_XBRL_CACHE_DIR=/app/.cache/xbrl
ENV XBRL_ENGINE_TIMEOUT_MS=45000
CMD ["sh", "-c", "bun run bootstrap:prod && bun server.js"]
CMD ["sh", "-c", "if [ ! -x \"${FISCAL_XBRL_BIN:-/app/bin/fiscal-xbrl}\" ]; then echo \"Missing Rust XBRL sidecar at ${FISCAL_XBRL_BIN:-/app/bin/fiscal-xbrl}\" >&2; exit 1; fi; bun run bootstrap:prod && bun server.js"]