Files
nibiru-framework.com/docs/Dockerfile
stephan f4ccc45a3b Strip api.neuronetz.ai from documentation; chat config stays in env
The Ollama URL was leaking via:
  - prose in /en/, /de/, /ja/, /es/, /fr/ docs (oracle, deployment,
    local-testing, ai/module/{overview,embed,training})
  - code blocks teaching users to curl the host directly
  - .env.example, Dockerfile, docker-compose.yml defaults
  - providers.mjs, translate-docs.mjs, build-oracle-index.mjs defaults
  - LandingScripts.astro comment
  - lora-runbook.md prose + SSH host
  - the GET handler at /api/oracle which echoed `ollamaUrl` back to public callers
  - the "Oracle is silent" fallback message at /api/oracle POST

Replacements:
  - prose: "neuronetz.ai" → "your Ollama instance"
  - example URLs in code blocks: https://api.neuronetz.aihttps://your-ollama-host.example
  - code-level defaults: → http://localhost:11434 (Ollama's standard local port)
  - GET /api/oracle: dropped the `ollamaUrl` field; provider + model still exposed
  - runbook SSH host: neuronetz@cloud.neuronetz.ai → <gpu-user>@<gpu-host>

Production chat is unaffected: docs/.env (gitignored) on the production
host still pins OLLAMA_BASE_URL=https://api.neuronetz.ai. The only
change in the running container is that the GET handler no longer
echoes the URL.

analytics.neuronetz.ai (Umami tracking) is intentionally left intact —
it's a public, brand-owned subdomain meant to be visible.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 17:14:17 +02:00

55 lines
1.7 KiB
Docker

# syntax=docker/dockerfile:1.6
# ============================================================================
# Nibiru docs site — multi-stage build
#
# Default backend: your Ollama at https://your-ollama-host.example (no API keys).
# See docker-compose.yml + .env.example for overrides.
# ============================================================================
FROM node:22-alpine AS builder
WORKDIR /app
ENV NODE_ENV=production
ENV NPM_CONFIG_PRODUCTION=false
COPY package.json package-lock.json .npmrc ./
RUN npm ci
COPY . .
# Build-time embedding generation. Soft-fails so missing models / network
# don't break the build — runtime falls back to chat-only mode.
ARG OLLAMA_BASE_URL=http://localhost:11434
ARG OLLAMA_EMBED_MODEL=nomic-embed-text
ARG EMBED_PROVIDER=ollama
ARG OPENAI_API_KEY=""
ENV OLLAMA_BASE_URL=$OLLAMA_BASE_URL
ENV OLLAMA_EMBED_MODEL=$OLLAMA_EMBED_MODEL
ENV EMBED_PROVIDER=$EMBED_PROVIDER
ENV OPENAI_API_KEY=$OPENAI_API_KEY
RUN node scripts/build-oracle-index.mjs || true
# Build the static site + SSR entry.
RUN npm run build:site
# Build the LoRA training corpus as a side artifact (deterministic, no API).
RUN node scripts/build-corpus.mjs || true
RUN npm prune --omit=dev
# ----------- Stage 2: runtime -----------------------------------------------
FROM node:22-alpine AS runtime
WORKDIR /app
ENV NODE_ENV=production
ENV HOST=0.0.0.0
ENV PORT=4321
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/public ./public
COPY --from=builder /app/scripts ./scripts
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
EXPOSE 4321
USER node
CMD ["node", "./dist/server/entry.mjs"]