From a6edb67f589c86aac888e5194fcccd1a961b5372 Mon Sep 17 00:00:00 2001 From: x032205 Date: Thu, 10 Jul 2025 20:34:56 -0400 Subject: [PATCH] Allow docs to run fully offline --- docs/Dockerfile | 30 ++++++++++++++++++++++++++++-- docs/docs.json | 25 ++++++++++++++++++++----- 2 files changed, 48 insertions(+), 7 deletions(-) diff --git a/docs/Dockerfile b/docs/Dockerfile index 34730d01e..079972544 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -1,6 +1,32 @@ -FROM node:20-alpine +FROM node:20-alpine AS builder + WORKDIR /app -RUN npm install -g mint + +RUN npm install -g mint@4.2.13 + COPY . . + +# Install a local version of our OpenAPI spec +RUN apk add --no-cache wget jq && \ + wget -O spec.json https://app.infisical.com/api/docs/json && \ + jq '.api.openapi = "./spec.json"' docs.json > temp.json && \ + mv temp.json docs.json + +# Run mint dev briefly to download the web client +RUN timeout 30 mint dev || true + +FROM node:20-alpine + +WORKDIR /app + +RUN npm install -g mint@4.2.13 + +COPY . . + +COPY --from=builder /root/.mintlify /root/.mintlify +COPY --from=builder /app/docs.json /app/docs.json +COPY --from=builder /app/spec.json /app/spec.json + EXPOSE 3000 + CMD ["mint", "dev"] diff --git a/docs/docs.json b/docs/docs.json index f8e7aee4e..8e6972429 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -78,7 +78,10 @@ }, { "group": "Infisical SSH", - "pages": ["documentation/platform/ssh/overview", "documentation/platform/ssh/host-groups"] + "pages": [ + "documentation/platform/ssh/overview", + "documentation/platform/ssh/host-groups" + ] }, { "group": "Key Management (KMS)", @@ -375,7 +378,10 @@ }, { "group": "Architecture", - "pages": ["internals/architecture/components", "internals/architecture/cloud"] + "pages": [ + "internals/architecture/components", + "internals/architecture/cloud" + ] }, "internals/security", "internals/service-tokens" @@ -546,7 +552,10 @@ "integrations/cloud/gcp-secret-manager", { "group": "Cloudflare", - "pages": ["integrations/cloud/cloudflare-pages", "integrations/cloud/cloudflare-workers"] + "pages": [ + "integrations/cloud/cloudflare-pages", + "integrations/cloud/cloudflare-workers" + ] }, "integrations/cloud/terraform-cloud", "integrations/cloud/databricks", @@ -658,7 +667,11 @@ "cli/commands/reset", { "group": "infisical scan", - "pages": ["cli/commands/scan", "cli/commands/scan-git-changes", "cli/commands/scan-install"] + "pages": [ + "cli/commands/scan", + "cli/commands/scan-git-changes", + "cli/commands/scan-install" + ] } ] }, @@ -982,7 +995,9 @@ "pages": [ { "group": "Kubernetes", - "pages": ["api-reference/endpoints/dynamic-secrets/kubernetes/create-lease"] + "pages": [ + "api-reference/endpoints/dynamic-secrets/kubernetes/create-lease" + ] }, "api-reference/endpoints/dynamic-secrets/create", "api-reference/endpoints/dynamic-secrets/update",