OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.
Python
# syntax=docker/dockerfile:1.4
# -----------------------------------------------------------------------------
# Stage: deps
# -----------------------------------------------------------------------------
FROM registry.access.redhat.com/ubi10/nodejs-24-minimal AS deps
WORKDIR /opt/app-root/src
USER 0
RUN microdnf update -y && microdnf clean all && rm -rf /var/cache/yum
COPY frontend/package.json frontend/package-lock.json ./
# Copy local stub packages referenced via file: in package.json (e.g. sharp stub
# that keeps LGPL libvips binaries out of the tree). npm ci needs these present.
COPY frontend/stubs ./stubs
RUN npm ci --prefer-offline --no-audit
# -----------------------------------------------------------------------------
# Stage: builder
# -----------------------------------------------------------------------------
FROM registry.access.redhat.com/ubi10/nodejs-24-minimal AS builder
WORKDIR /opt/app-root/src
USER 0
# Restrict the placeholder to container image builds. The entrypoint replaces
# it in a writable per-pod copy of the assets before starting the server.
ENV OPENRAG_FRONTEND_RUNTIME_BASE_PATH=true
COPY --from=deps /opt/app-root/src/node_modules ./node_modules
COPY --from=deps /opt/app-root/src/stubs ./stubs
COPY frontend/package*.json ./
COPY frontend/ ./
RUN npm run build \
&& npm prune --omit=dev
# -----------------------------------------------------------------------------
# Stage: runtime
# -----------------------------------------------------------------------------
FROM registry.access.redhat.com/ubi10/nodejs-24-minimal AS runtime
WORKDIR /opt/app-root/src
USER 0
# The npm CLI is only needed to install and build, so the runtime stage drops
# it. Its bundled dependencies (e.g. undici via node-gyp) otherwise ship in the
# image and get flagged by scanners (CVE-2026-15157, CVE-2026-16728,
# CVE-2026-16729).
RUN microdnf update -y \
&& microdnf remove -y nodejs24-npm \
&& microdnf clean all && rm -rf /var/cache/yum
ENV NODE_ENV=production \
NEXT_TELEMETRY_DISABLED=1
# CWE-426 fix: explicitly set PATH so system-owned directories are always resolved
# first. App venv dirs are appended last so they cannot shadow system binaries.
# Matches the ordering used by the upstream image but with system dirs promoted
# to the front.
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/app-root/bin:/opt/app-root/src/bin:/opt/app-root/src/.local/bin
COPY --from=builder --chown=1001:0 /opt/app-root/src/.next/standalone ./
COPY --from=builder --chown=1001:0 /opt/app-root/src/.next/static ./.next/static
COPY --from=builder --chown=1001:0 /opt/app-root/src/public ./public
COPY --chown=1001:0 frontend/entrypoint.sh ./entrypoint.sh
EXPOSE 3000 9090
USER 1001
ENTRYPOINT ["./entrypoint.sh"]
CMD ["node", "server.js"]