docs(deploy): add local-slim and local-full Docker Compose examples and update docs
Introduce compose.local-slim.yml and compose.local-full.yml for local builds of OpenReader and compute-worker. Update deployment documentation to describe new compose variants and usage. Adjust package.json scripts to support local-slim and local-full workflows. Rename compose files and update stack names for clarity.
This commit is contained in:
parent
9520e26a00
commit
6b13a3394b
6 changed files with 98 additions and 22 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
name: openreader-example
|
name: openreader-full
|
||||||
|
|
||||||
services:
|
services:
|
||||||
openreader:
|
openreader:
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
name: openreader-local-build
|
name: openreader-local-full-build
|
||||||
|
|
||||||
services:
|
services:
|
||||||
openreader:
|
openreader:
|
||||||
52
docker/examples/compose.local-slim.yml
Normal file
52
docker/examples/compose.local-slim.yml
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
name: openreader-local-slim-build
|
||||||
|
|
||||||
|
services:
|
||||||
|
openreader:
|
||||||
|
image: openreader:local
|
||||||
|
build:
|
||||||
|
context: ../..
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
depends_on:
|
||||||
|
kokoro-tts:
|
||||||
|
condition: service_started
|
||||||
|
environment:
|
||||||
|
BASE_URL: ${BASE_URL:-http://localhost:3003}
|
||||||
|
AUTH_SECRET: ${AUTH_SECRET:-local-openreader-auth-secret-change-me}
|
||||||
|
RUNTIME_SEED_JSON: |-
|
||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"runtimeConfig": {
|
||||||
|
"defaultTtsProvider": "kokoro"
|
||||||
|
},
|
||||||
|
"providers": [
|
||||||
|
{
|
||||||
|
"slug": "kokoro",
|
||||||
|
"displayName": "Kokoro",
|
||||||
|
"providerType": "custom-openai",
|
||||||
|
"baseUrl": "http://kokoro-tts:8880/v1",
|
||||||
|
"defaultModel": "kokoro",
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
ports:
|
||||||
|
- "3003:3003"
|
||||||
|
- "8333:8333"
|
||||||
|
volumes:
|
||||||
|
- openreader-docstore:/app/docstore
|
||||||
|
|
||||||
|
kokoro-tts:
|
||||||
|
image: ghcr.io/remsky/kokoro-fastapi-cpu:v0.2.4
|
||||||
|
environment:
|
||||||
|
ONNX_NUM_THREADS: 8
|
||||||
|
ONNX_INTER_OP_THREADS: 4
|
||||||
|
ONNX_EXECUTION_MODE: parallel
|
||||||
|
ONNX_OPTIMIZATION_LEVEL: all
|
||||||
|
ONNX_MEMORY_PATTERN: "true"
|
||||||
|
ONNX_ARENA_EXTEND_STRATEGY: kNextPowerOfTwo
|
||||||
|
API_LOG_LEVEL: DEBUG
|
||||||
|
ports:
|
||||||
|
- "8880:8880"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
openreader-docstore:
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
name: openreader-slim-example
|
name: openreader-slim
|
||||||
|
|
||||||
services:
|
services:
|
||||||
openreader:
|
openreader:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: Docker Compose
|
title: Docker Compose
|
||||||
description: Run OpenReader with the slim, full, or local-build Docker Compose examples.
|
description: Run OpenReader with the slim, full, local-slim, or local-full Docker Compose examples.
|
||||||
---
|
---
|
||||||
|
|
||||||
import Tabs from '@theme/Tabs';
|
import Tabs from '@theme/Tabs';
|
||||||
|
|
@ -8,7 +8,8 @@ import TabItem from '@theme/TabItem';
|
||||||
|
|
||||||
Use these examples to run OpenReader with Kokoro-FastAPI and persistent storage. Choose the slim
|
Use these examples to run OpenReader with Kokoro-FastAPI and persistent storage. Choose the slim
|
||||||
stack for the simplest deployment, or the full stack when you want PostgreSQL, SeaweedFS, NATS,
|
stack for the simplest deployment, or the full stack when you want PostgreSQL, SeaweedFS, NATS,
|
||||||
and the compute worker as separate containers.
|
and the compute worker as separate containers. Local build variants are also available for both slim
|
||||||
|
and full stacks to build the application from your current checkout.
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
|
|
@ -54,31 +55,42 @@ For details about running the worker separately, see
|
||||||
[Compute Worker](./compute-worker).
|
[Compute Worker](./compute-worker).
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem value="local" label="Local Build">
|
<TabItem value="local-slim" label="Local Slim">
|
||||||
|
|
||||||
The local-build example uses the full multi-container layout, but builds the OpenReader app and
|
The local-slim example runs a slim setup (OpenReader and Kokoro-FastAPI), but builds the OpenReader app image from the current checkout.
|
||||||
compute-worker images from the current checkout.
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker compose -f docker/examples/compose.local.yml up --build
|
docker compose -f docker/examples/compose.local-slim.yml up --build
|
||||||
# Repository convenience command: pnpm compose:local
|
# Repository convenience command: pnpm compose:local
|
||||||
```
|
```
|
||||||
|
|
||||||
Compose file: [`docker/examples/compose.local.yml`](https://github.com/richardr1126/openreader/blob/main/docker/examples/compose.local.yml)
|
Compose file: [`docker/examples/compose.local-slim.yml`](https://github.com/richardr1126/openreader/blob/main/docker/examples/compose.local-slim.yml)
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
<TabItem value="local-full" label="Local Full">
|
||||||
|
|
||||||
|
The local-full example uses the full multi-container layout, but builds the OpenReader app and compute-worker images from the current checkout.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose -f docker/examples/compose.local-full.yml up --build
|
||||||
|
# Repository convenience command: pnpm compose:local:full
|
||||||
|
```
|
||||||
|
|
||||||
|
Compose file: [`docker/examples/compose.local-full.yml`](https://github.com/richardr1126/openreader/blob/main/docker/examples/compose.local-full.yml)
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
## Included services
|
## Included services
|
||||||
|
|
||||||
| Service | Slim | Full | Local Build |
|
| Service | Slim | Full | Local Slim | Local Full |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| OpenReader | Published image | Published image | Local build |
|
| OpenReader | Published image | Published image | Local build | Local build |
|
||||||
| Kokoro-FastAPI | Container | Container | Container |
|
| Kokoro-FastAPI | Container | Container | Container | Container |
|
||||||
| Database | Embedded SQLite | PostgreSQL container | PostgreSQL container |
|
| Database | Embedded SQLite | PostgreSQL container | Embedded SQLite | PostgreSQL container |
|
||||||
| SeaweedFS | Embedded | Container | Container |
|
| SeaweedFS | Embedded | Container | Embedded | Container |
|
||||||
| NATS | Embedded | Container | Container |
|
| NATS | Embedded | Container | Embedded | Container |
|
||||||
| Compute worker | Embedded | Published image | Local build |
|
| Compute worker | Embedded | Published image | Embedded | Local build |
|
||||||
|
|
||||||
On first boot, `RUNTIME_SEED_JSON` creates an enabled Kokoro shared provider and selects it as the
|
On first boot, `RUNTIME_SEED_JSON` creates an enabled Kokoro shared provider and selects it as the
|
||||||
default TTS provider.
|
default TTS provider.
|
||||||
|
|
@ -118,15 +130,25 @@ docker compose -f docker/examples/compose.full.yml up
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem value="local" label="Local Build">
|
<TabItem value="local-slim" label="Local Slim">
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
BASE_URL=http://192.168.0.XXX:3003 \
|
BASE_URL=http://192.168.0.XXX:3003 \
|
||||||
S3_ENDPOINT=http://192.168.0.XXX:8333 \
|
S3_ENDPOINT=http://192.168.0.XXX:8333 \
|
||||||
docker compose -f docker/examples/compose.local.yml up --build
|
docker compose -f docker/examples/compose.local-slim.yml up --build
|
||||||
# Repository convenience command: pnpm compose:local
|
# Repository convenience command: pnpm compose:local
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</TabItem>
|
||||||
|
<TabItem value="local-full" label="Local Full">
|
||||||
|
|
||||||
|
```bash
|
||||||
|
BASE_URL=http://192.168.0.XXX:3003 \
|
||||||
|
S3_ENDPOINT=http://192.168.0.XXX:8333 \
|
||||||
|
docker compose -f docker/examples/compose.local-full.yml up --build
|
||||||
|
# Repository convenience command: pnpm compose:local:full
|
||||||
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
|
|
@ -134,7 +156,7 @@ Replace `192.168.0.XXX` with your Docker host's LAN IP and allow inbound TCP por
|
||||||
`8333` through its firewall.
|
`8333` through its firewall.
|
||||||
|
|
||||||
:::info Internal full-stack endpoint
|
:::info Internal full-stack endpoint
|
||||||
The full and local-build compute workers continue using `http://seaweedfs:8333` internally.
|
The full and local-full compute workers continue using `http://seaweedfs:8333` internally.
|
||||||
`S3_ENDPOINT` configures the app endpoint and browser-facing presigned URLs.
|
`S3_ENDPOINT` configures the app endpoint and browser-facing presigned URLs.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,9 @@
|
||||||
"test:compute": "vitest run --project compute-worker",
|
"test:compute": "vitest run --project compute-worker",
|
||||||
"compose": "docker compose -f docker/examples/compose.yml up",
|
"compose": "docker compose -f docker/examples/compose.yml up",
|
||||||
"compose:full": "docker compose -f docker/examples/compose.full.yml up",
|
"compose:full": "docker compose -f docker/examples/compose.full.yml up",
|
||||||
"compose:local": "docker compose -f docker/examples/compose.local.yml up --build",
|
"compose:local": "docker compose -f docker/examples/compose.local-slim.yml up --build",
|
||||||
|
"compose:local:slim": "docker compose -f docker/examples/compose.local-slim.yml up --build",
|
||||||
|
"compose:local:full": "docker compose -f docker/examples/compose.local-full.yml up --build",
|
||||||
"migrate": "pnpm --filter @openreader/database migrate",
|
"migrate": "pnpm --filter @openreader/database migrate",
|
||||||
"migrate-fs": "pnpm --filter @openreader/bootstrap migrate-storage",
|
"migrate-fs": "pnpm --filter @openreader/bootstrap migrate-storage",
|
||||||
"migrate-fs:dry-run": "pnpm --filter @openreader/bootstrap migrate-storage --dry-run true",
|
"migrate-fs:dry-run": "pnpm --filter @openreader/bootstrap migrate-storage --dry-run true",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue