Skip to content

Commit 5b72557

Browse files
HuntaScott-at-Warp
authored andcommitted
[dark-mode] Add production deployment and setup instructions
- Update Dockerfile.prod to use Node 20 with --ignore-engines for yarn installs - Update docker-compose.yml to build from local source with proper port mapping - Add docs-config.local.yaml with required port and configuration - Update PULL_REQUEST.md with Getting Started guide for yarn dev and Docker deployment - Document Node.js version requirements and --ignore-engines usage - Include database migration notes for nedb to @seald-io/nedb"
1 parent 1e81fd9 commit 5b72557

File tree

6 files changed

+600
-17557
lines changed

6 files changed

+600
-17557
lines changed

.github/specs/dark-mode/PULL_REQUEST.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,59 @@ yarn test:e2e:ui
9696
```
9797

9898
Toggle the sun/moon button in the header to switch themes. Preference persists across reloads and pages. Remove localStorage key `codex-docs-theme` to reset to system default.
99+
100+
### Getting Started
101+
102+
#### Prerequisites
103+
104+
- **Node.js 20+** is required (eslint-plugin-jsdoc@62.9.0+ only supports Node 20+)
105+
- Docker (optional, for containerized deployment)
106+
107+
#### Local Development with Yarn
108+
109+
1. **Install dependencies:**
110+
```bash
111+
yarn install --ignore-engines
112+
```
113+
(The `--ignore-engines` flag bypasses Node version warnings for some transitive dependencies)
114+
115+
2. **Start the development server:**
116+
```bash
117+
yarn dev
118+
```
119+
This runs the backend on `http://localhost:3000` and watches frontend assets.
120+
121+
3. **Access the app:**
122+
Open http://localhost:3000 and use the sun/moon toggle button in the header (top-right) to switch themes.
123+
124+
#### Production with Docker
125+
126+
1. **Create a local config file:**
127+
```bash
128+
# Copy the default config
129+
cp docs-config.yaml docs-config.local.yaml
130+
```
131+
Update `port: 7777` and `host: "0.0.0.0"` in `docs-config.local.yaml` if needed.
132+
133+
2. **Build and start the container:**
134+
```bash
135+
docker compose up -d --build
136+
```
137+
The app will be available at http://localhost:7777
138+
139+
3. **Verify the container:**
140+
```bash
141+
docker logs codexdocs-docs-1 --tail 20
142+
```
143+
You should see: `CodeX Docs server is running`
144+
145+
#### Important Notes
146+
147+
- **Node 22 on local machine:** If you're running Node 22 locally and encounter `eslint-plugin-jsdoc` engine errors during `yarn install`, use the `--ignore-engines` flag:
148+
```bash
149+
yarn install --ignore-engines
150+
```
151+
152+
- **Docker builds:** The Dockerfile.prod uses Node 20 and includes `--ignore-engines` flags in yarn install commands to ensure compatibility.
153+
154+
- **Database:** This PR migrates from `nedb` to `@seald-io/nedb`. The new package is a drop-in replacement with identical on-disk format — no data migration required.

docker-compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
services:
22
docs:
3-
image: ghcr.io/codex-team/codex.docs:v2.0.0-rc.8
3+
build:
4+
context: .
5+
dockerfile: docker/Dockerfile.prod
46
ports:
57
- "7777:7777"
68
volumes:

docker/Dockerfile.prod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Stage 1 - build
2-
FROM node:16.14.0-alpine3.15 as build
2+
FROM node:20-alpine as build
33

44
## Install build toolchain, install node deps and compile native add-ons
55
RUN apk add --no-cache python3 make g++ git
@@ -8,18 +8,18 @@ WORKDIR /usr/src/app
88

99
COPY package.json yarn.lock ./
1010

11-
RUN yarn install --production
11+
RUN yarn install --production --ignore-engines
1212

1313
RUN cp -R node_modules prod_node_modules
1414

15-
RUN yarn install
15+
RUN yarn install --ignore-engines
1616

1717
COPY . .
1818

1919
RUN yarn build-all
2020

2121
# Stage 2 - make final image
22-
FROM node:16.14.0-alpine3.15
22+
FROM node:20-alpine
2323

2424
WORKDIR /usr/src/app
2525

0 commit comments

Comments
 (0)