The Meta Earth documentation site is built with Docusaurus and uses pnpm as its package manager.
- Node.js
18+ pnpm 10.33.0installed manually
pnpm installpnpm startThe development server starts on port 3001 by default.
pnpm run build:prodThe build output is generated in the build directory.
pnpm run build:uatThis command reads .env.uat and generates the build output for the UAT environment.
pnpm run serve:prod --host 0.0.0.0 --port 3000This command reads .env.production and serves the static output with Docusaurus' built-in serve command.
pnpm run serve:uat --host 0.0.0.0 --port 3000This command reads .env.uat and serves the static output with Docusaurus' built-in serve command.
The APP_ENV build argument in the current Dockerfile defaults to production.
If you do not explicitly pass --build-arg APP_ENV=... when building the image, the production configuration is used.
During the Docker build stage, the following commands are executed:
pnpm install
pnpm run build:prodAt runtime, the container starts Docusaurus with the local project binary:
./node_modules/.bin/docusaurus serve --host 0.0.0.0 --port 3000The environment file used by the container is determined by APP_ENV:
APP_ENV=production->.env.productionAPP_ENV=uat->.env.uat
If docker run does not explicitly pass -e APP_ENV=...,
the container inherits the APP_ENV value baked into the image, which is the value used at build time.
It is recommended to keep the build environment and runtime environment aligned rather than mixing them.
Build the production image:
docker build -t me-docs:prod --build-arg APP_ENV=production .Start the production container:
docker rm -f me-docs-prod
docker run -d --name me-docs-prod -e APP_ENV=production -p 3000:3000 me-docs:prodView the production container logs:
docker logs -f me-docs-prodBuild the UAT image:
docker build -t me-docs:uat --build-arg APP_ENV=uat .Start the UAT container:
docker rm -f me-docs-uat
docker run -d --name me-docs-uat -e APP_ENV=uat -p 3001:3000 me-docs:uatView the UAT container logs:
docker logs -f me-docs-uatStop the containers:
docker stop me-docs-prod
docker stop me-docs-uatRemove the containers:
docker rm -f me-docs-prod
docker rm -f me-docs-uatCheck container status:
docker ps --filter "name=me-docs"The Docker image uses .env.production from the repository by default.
Current key settings:
gitPath=https://github.com/openmetaearth/me-docs
siteUrl=https://docs.mec.meRunning build:uat or serve:uat locally reads .env.uat.
If APP_ENV=uat is passed during Docker build or runtime, .env.uat is also used.