Skip to content

Commit ee79ef2

Browse files
authored
Merge pull request #1722 from marcellodesales/feature/dockerized-docs-support
🐛 fix plugins.md formatting for docs with dockerized docs validation
2 parents 3b36e79 + 790e6e1 commit ee79ef2

File tree

5 files changed

+84
-4
lines changed

5 files changed

+84
-4
lines changed

Dockerfile.docs

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# syntax=docker/dockerfile:1
2+
3+
## Modified version of https://docusaurus.community/knowledge/deployment/docker/
4+
5+
# Stage 1: Base image.
6+
## Start with a base image containing NodeJS so we can build Docusaurus.
7+
FROM node:23.3.0-slim AS base
8+
## Disable colour output from yarn to make logs easier to read.
9+
10+
## https://pnpm.io/docker
11+
ENV PNPM_HOME="/pnpm"
12+
ENV PATH="$PNPM_HOME:$PATH"
13+
14+
ENV FORCE_COLOR=0
15+
## Enable corepack.
16+
RUN corepack enable
17+
## Set the working directory to `/opt/docusaurus`.
18+
WORKDIR /opt/docusaurus
19+
20+
## Required by docusaurus: [ERROR] Loading of version failed for version current
21+
RUN apt-get update && apt-get install -y git
22+
23+
FROM base AS dev
24+
## Set the working directory to `/opt/docusaurus`.
25+
WORKDIR /opt/docusaurus
26+
## Expose the port that Docusaurus will run on.
27+
EXPOSE 3000
28+
## Run the development server.
29+
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
30+
31+
# Stage 2b: Production build mode.
32+
FROM base AS prod
33+
## Set the working directory to `/opt/docusaurus`.
34+
WORKDIR /opt/docusaurus
35+
36+
COPY docs/package.json /opt/docusaurus/package.json
37+
COPY docs/package-lock.json /opt/docusaurus/package-lock.json
38+
39+
## Install dependencies with `--immutable` to ensure reproducibility.
40+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install
41+
42+
## Copy over the source code.
43+
COPY docs/ /opt/docusaurus/
44+
COPY packages/ /opt/packages/
45+
46+
## Required buy docusaurus [ERROR] Loading of version failed for version current
47+
COPY .git/ /opt/.git/
48+
49+
# Build from sources
50+
RUN pnpm run build
51+
52+
# Stage 3a: Serve with `docusaurus serve`.
53+
FROM prod AS serve
54+
## Expose the port that Docusaurus will run on.
55+
EXPOSE 3000
56+
## Run the production server.
57+
CMD ["npm", "run", "serve", "--", "--host", "0.0.0.0", "--no-open"]
58+

docker-compose-docs.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
docs:
3+
build:
4+
dockerfile: Dockerfile.docs
5+
context: .
6+
target: serve
7+
ports:
8+
- 3000:3000
9+

docs/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,13 @@ Tests are written using Jest and can be found in `src/**/*.test.ts` files. The t
179179
- Run tests in sequence (--runInBand)
180180

181181
To create new tests, add a `.test.ts` file adjacent to the code you're testing.
182+
183+
## Docs Updates
184+
185+
Please make sure to vetify if the documentation provided is correct. In order to do so, please run the docs service.
186+
187+
```console
188+
docker compose -f docker-compose-docs.yaml up --build
189+
```
190+
191+
The docusaurus server will get started and you can verify it locally at https://localhost:3000/eliza.

docs/docs/packages/plugins.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -610,12 +610,12 @@ The Fuel plugin provides an interface to the Fuel Ignition blockchain.
610610
**Actions:**
611611

612612
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**:
613-
`json
614-
{
613+
```json
614+
{
615615
"toAddress": "0x8F8afB12402C9a4bD9678Bec363E51360142f8443FB171655eEd55dB298828D1",
616616
"amount": "0.00001"
617-
}
618-
`
617+
}
618+
```
619619
**Setup and Configuration:**
620620

621621
1. **Configure the Plugin**

docs/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "eliza-docs",
33
"version": "0.1.7-alpha.2",
44
"private": true,
5+
"packageManager": "pnpm@9.4.0",
56
"scripts": {
67
"docusaurus": "docusaurus",
78
"start": "docusaurus start --no-open",
@@ -21,9 +22,11 @@
2122
"@docusaurus/plugin-ideal-image": "3.6.3",
2223
"@docusaurus/preset-classic": "3.6.3",
2324
"@docusaurus/theme-mermaid": "3.6.3",
25+
"@docusaurus/theme-common": "3.6.3",
2426
"@mdx-js/react": "3.0.1",
2527
"clsx": "2.1.1",
2628
"docusaurus-lunr-search": "3.5.0",
29+
"lunr": "2.3.9",
2730
"dotenv": "^16.4.7",
2831
"prism-react-renderer": "2.3.1",
2932
"react": "18.3.1",

0 commit comments

Comments
 (0)