diff --git a/Dockerfile.docs b/Dockerfile.docs new file mode 100644 index 0000000000..ae2ea6bf14 --- /dev/null +++ b/Dockerfile.docs @@ -0,0 +1,58 @@ +# syntax=docker/dockerfile:1 + +## Modified version of https://docusaurus.community/knowledge/deployment/docker/ + +# Stage 1: Base image. +## Start with a base image containing NodeJS so we can build Docusaurus. +FROM node:23.3.0-slim AS base +## Disable colour output from yarn to make logs easier to read. + +## https://pnpm.io/docker +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" + +ENV FORCE_COLOR=0 +## Enable corepack. +RUN corepack enable +## Set the working directory to `/opt/docusaurus`. +WORKDIR /opt/docusaurus + +## Required by docusaurus: [ERROR] Loading of version failed for version current +RUN apt-get update && apt-get install -y git + +FROM base AS dev +## Set the working directory to `/opt/docusaurus`. +WORKDIR /opt/docusaurus +## Expose the port that Docusaurus will run on. +EXPOSE 3000 +## Run the development server. +CMD [ -d "node_modules" ] && npm run start -- --host 0.0.0.0 --poll 1000 || pnpm install && pnpm run start -- --host 0.0.0.0 --poll 1000 + +# Stage 2b: Production build mode. +FROM base AS prod +## Set the working directory to `/opt/docusaurus`. +WORKDIR /opt/docusaurus + +COPY docs/package.json /opt/docusaurus/package.json +COPY docs/package-lock.json /opt/docusaurus/package-lock.json + +## Install dependencies with `--immutable` to ensure reproducibility. +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install + +## Copy over the source code. +COPY docs/ /opt/docusaurus/ +COPY packages/ /opt/packages/ + +## Required buy docusaurus [ERROR] Loading of version failed for version current +COPY .git/ /opt/.git/ + +# Build from sources +RUN pnpm run build + +# Stage 3a: Serve with `docusaurus serve`. +FROM prod AS serve +## Expose the port that Docusaurus will run on. +EXPOSE 3000 +## Run the production server. +CMD ["npm", "run", "serve", "--", "--host", "0.0.0.0", "--no-open"] + diff --git a/docker-compose-docs.yaml b/docker-compose-docs.yaml new file mode 100644 index 0000000000..5103dea5dc --- /dev/null +++ b/docker-compose-docs.yaml @@ -0,0 +1,9 @@ +services: + docs: + build: + dockerfile: Dockerfile.docs + context: . + target: serve + ports: + - 3000:3000 + diff --git a/docs/README.md b/docs/README.md index 5e4da17b9a..3b1791b826 100644 --- a/docs/README.md +++ b/docs/README.md @@ -179,3 +179,13 @@ Tests are written using Jest and can be found in `src/**/*.test.ts` files. The t - Run tests in sequence (--runInBand) To create new tests, add a `.test.ts` file adjacent to the code you're testing. + +## Docs Updates + +Please make sure to vetify if the documentation provided is correct. In order to do so, please run the docs service. + +```console +docker compose -f docker-compose-docs.yaml up --build +``` + +The docusaurus server will get started and you can verify it locally at https://localhost:3000/eliza. diff --git a/docs/docs/packages/plugins.md b/docs/docs/packages/plugins.md index 8e13cf7062..50e01a8419 100644 --- a/docs/docs/packages/plugins.md +++ b/docs/docs/packages/plugins.md @@ -610,12 +610,12 @@ The Fuel plugin provides an interface to the Fuel Ignition blockchain. **Actions:** 1. `TRANSFER_FUEL_ETH` - Transfer ETH to a given Fuel address. - **Inputs**: - `toAddress` (string): The Fuel address to transfer ETH to. - `amount` (string): The amount of ETH to transfer. - **Outputs**: Confirmation message with transaction details. - **Example**: - `json -{ + ```json + { "toAddress": "0x8F8afB12402C9a4bD9678Bec363E51360142f8443FB171655eEd55dB298828D1", "amount": "0.00001" -} -` + } + ``` **Setup and Configuration:** 1. **Configure the Plugin** diff --git a/docs/package.json b/docs/package.json index 4956c66cf9..3cd7c59c18 100644 --- a/docs/package.json +++ b/docs/package.json @@ -2,6 +2,7 @@ "name": "eliza-docs", "version": "0.1.7-alpha.2", "private": true, + "packageManager": "pnpm@9.4.0", "scripts": { "docusaurus": "docusaurus", "start": "docusaurus start --no-open", @@ -21,9 +22,11 @@ "@docusaurus/plugin-ideal-image": "3.6.3", "@docusaurus/preset-classic": "3.6.3", "@docusaurus/theme-mermaid": "3.6.3", + "@docusaurus/theme-common": "3.6.3", "@mdx-js/react": "3.0.1", "clsx": "2.1.1", "docusaurus-lunr-search": "3.5.0", + "lunr": "2.3.9", "dotenv": "^16.4.7", "prism-react-renderer": "2.3.1", "react": "18.3.1",