Skip to content

Commit 1214abf

Browse files
committed
Improve on-premises docs structure, flow, and placeholder consistency
- Reorder nav: MCP moved after TinyMCE Integration, marked optional - Un-collapse token server, K8s manifest, and MySQL compose file - Add "Next steps" section to Getting Started bridging to production - Replace dynamic launch script with static docker run + TIP - Add expected boot log after docker run - Promote prerequisites to "Before you begin" with verification commands - Add complete docker run reference to Reference page - Add numbered steps (1-5) to Production K8s section - Standardize placeholders to <kebab-case> format across all pages - Condense agent-1 explanation on Providers page - Remove raw management API reference from Production page
1 parent ccfe41e commit 1214abf

7 files changed

Lines changed: 136 additions & 108 deletions

modules/ROOT/nav.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,10 @@
274274
***** xref:tinymceai-on-premises-getting-started.adoc[Getting started]
275275
***** xref:tinymceai-on-premises-database.adoc[Database, Redis, and storage]
276276
***** xref:tinymceai-on-premises-providers.adoc[LLM providers]
277-
***** xref:tinymceai-on-premises-mcp.adoc[MCP and web integrations]
278277
***** xref:tinymceai-on-premises-jwt.adoc[JWT authentication]
279278
***** xref:tinymceai-on-premises-frameworks.adoc[TinyMCE integration]
280279
***** xref:tinymceai-on-premises-production.adoc[Production deployment]
280+
***** xref:tinymceai-on-premises-mcp.adoc[MCP and web integrations (optional)]
281281
***** xref:tinymceai-on-premises-troubleshooting.adoc[Troubleshooting]
282282
***** xref:tinymceai-on-premises-reference.adoc[Reference]
283283
**** xref:ai.adoc[AI Assistant (legacy)]

modules/ROOT/pages/tinymceai-on-premises-database.adoc

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,11 @@ The AI service supports both MySQL and PostgreSQL equally. Pick whichever the op
3737

3838
== Choosing a setup path
3939

40+
Use Docker Compose for evaluation, managed cloud services (Amazon RDS, Cloud SQL, Azure Database) for production. All paths produce the same end state: a running database the AI service can connect to. Both MySQL and PostgreSQL are supported in every configuration.
41+
4042
[.text-center]
4143
image::tinymceai-on-premises/database-setup-fig-1.svg[Database setup decision tree: local Docker Compose vs managed cloud database for evaluation and production,width=100%]
4244

43-
All paths produce the same end state: a running database the AI service can connect to.
44-
45-
[cols="1,1,1",options="header"]
46-
|===
47-
|Path |MySQL |PostgreSQL
48-
49-
|Docker / Podman |Yes |Yes
50-
|Docker Compose |Yes |Yes
51-
|Native (macOS / Linux) |Yes |Yes
52-
|Managed cloud (RDS, Cloud SQL, Azure) |Yes |Yes
53-
|===
54-
5545

5646

5747
[[postgresql-schema-prerequisite]]
@@ -117,7 +107,7 @@ The database user needs enough privilege to create, alter, and operate on these
117107

118108
[source,sql]
119109
----
120-
CREATE USER 'ai_service'@'%' IDENTIFIED BY 'STRONG_PASSWORD';
110+
CREATE USER 'ai_service'@'%' IDENTIFIED BY '<strong-password>';
121111
GRANT SELECT, INSERT, UPDATE, DELETE,
122112
ALTER, CREATE, DROP, INDEX,
123113
TRIGGER, LOCK TABLES, REFERENCES
@@ -145,7 +135,7 @@ If `DATABASE_SCHEMA=public` was chosen (see <<postgresql-schema-prerequisite>>),
145135

146136
[source,sql]
147137
----
148-
CREATE USER ai_service WITH PASSWORD 'STRONG_PASSWORD';
138+
CREATE USER ai_service WITH PASSWORD '<strong-password>';
149139
CREATE DATABASE ai_service OWNER ai_service;
150140
\c ai_service
151141
CREATE SCHEMA "cs-on-premises" AUTHORIZATION ai_service;
@@ -175,19 +165,17 @@ The sections below provide ready-to-use configuration for each database engine.
175165

176166
=== Docker Compose (recommended for evaluation)
177167

178-
.MySQL compose file
179-
[%collapsible]
180-
====
181168
[source,yaml]
169+
.MySQL compose file
182170
----
183171
services:
184172
mysql:
185173
image: mysql:8.0
186174
environment:
187-
MYSQL_ROOT_PASSWORD: ROOT_PASSWORD
175+
MYSQL_ROOT_PASSWORD: <root-password>
188176
MYSQL_DATABASE: ai_service
189177
MYSQL_USER: ai_service
190-
MYSQL_PASSWORD: STRONG_PASSWORD
178+
MYSQL_PASSWORD: <strong-password>
191179
ports:
192180
- "3306:3306"
193181
volumes:
@@ -211,7 +199,6 @@ services:
211199
volumes:
212200
mysql_data:
213201
----
214-
====
215202

216203
.PostgreSQL compose file
217204
[%collapsible]
@@ -224,7 +211,7 @@ services:
224211
environment:
225212
POSTGRES_DB: ai_service
226213
POSTGRES_USER: ai_service
227-
POSTGRES_PASSWORD: STRONG_PASSWORD
214+
POSTGRES_PASSWORD: <strong-password>
228215
ports:
229216
- "5432:5432"
230217
volumes:
@@ -269,10 +256,10 @@ Use these `docker run` commands when Docker Compose is not available or when int
269256
----
270257
docker run -d \
271258
--name ai-mysql \
272-
-e MYSQL_ROOT_PASSWORD=ROOT_PASSWORD \
259+
-e MYSQL_ROOT_PASSWORD=<root-password> \
273260
-e MYSQL_DATABASE=ai_service \
274261
-e MYSQL_USER=ai_service \
275-
-e MYSQL_PASSWORD=STRONG_PASSWORD \
262+
-e MYSQL_PASSWORD=<strong-password> \
276263
-p 3306:3306 \
277264
-v ai_mysql_data:/var/lib/mysql \
278265
mysql:8.0
@@ -288,7 +275,7 @@ docker run -d \
288275
--name ai-postgres \
289276
-e POSTGRES_DB=ai_service \
290277
-e POSTGRES_USER=ai_service \
291-
-e POSTGRES_PASSWORD=STRONG_PASSWORD \
278+
-e POSTGRES_PASSWORD=<strong-password> \
292279
-p 5432:5432 \
293280
-v ai_pg_data:/var/lib/postgresql/data \
294281
postgres:16
@@ -319,7 +306,7 @@ brew services start mysql
319306
mysql_secure_installation
320307
mysql -u root -p <<'SQL'
321308
CREATE DATABASE ai_service;
322-
CREATE USER 'ai_service'@'%' IDENTIFIED BY 'STRONG_PASSWORD';
309+
CREATE USER 'ai_service'@'%' IDENTIFIED BY '<strong-password>';
323310
GRANT SELECT, INSERT, UPDATE, DELETE, ALTER, CREATE, DROP,
324311
INDEX, TRIGGER, LOCK TABLES, REFERENCES
325312
ON ai_service.* TO 'ai_service'@'%';
@@ -361,7 +348,7 @@ sudo systemctl enable --now mysql
361348
sudo mysql_secure_installation
362349
sudo mysql <<'SQL'
363350
CREATE DATABASE ai_service;
364-
CREATE USER 'ai_service'@'%' IDENTIFIED BY 'STRONG_PASSWORD';
351+
CREATE USER 'ai_service'@'%' IDENTIFIED BY '<strong-password>';
365352
GRANT SELECT, INSERT, UPDATE, DELETE, ALTER, CREATE, DROP,
366353
INDEX, TRIGGER, LOCK TABLES, REFERENCES
367354
ON ai_service.* TO 'ai_service'@'%';
@@ -379,7 +366,7 @@ sudo apt update
379366
sudo apt install -y postgresql postgresql-contrib
380367
sudo systemctl enable --now postgresql
381368
sudo -u postgres psql <<'SQL'
382-
CREATE USER ai_service WITH PASSWORD 'STRONG_PASSWORD';
369+
CREATE USER ai_service WITH PASSWORD '<strong-password>';
383370
CREATE DATABASE ai_service OWNER ai_service;
384371
SQL
385372
sudo -u postgres psql -d ai_service \
@@ -653,7 +640,7 @@ After provisioning the database and Redis, pass the connection details to the AI
653640
-e DATABASE_HOST='mysql' \
654641
-e DATABASE_PORT='3306' \
655642
-e DATABASE_USER='ai_service' \
656-
-e DATABASE_PASSWORD='STRONG_PASSWORD' \
643+
-e DATABASE_PASSWORD='<strong-password>' \
657644
-e DATABASE_DATABASE='ai_service' \
658645
-e REDIS_HOST='redis' \
659646
-e REDIS_PORT='6379'
@@ -667,7 +654,7 @@ After provisioning the database and Redis, pass the connection details to the AI
667654
-e DATABASE_HOST='postgres' \
668655
-e DATABASE_PORT='5432' \
669656
-e DATABASE_USER='ai_service' \
670-
-e DATABASE_PASSWORD='STRONG_PASSWORD' \
657+
-e DATABASE_PASSWORD='<strong-password>' \
671658
-e DATABASE_DATABASE='ai_service' \
672659
-e DATABASE_SCHEMA='cs-on-premises' \
673660
-e REDIS_HOST='redis' \
@@ -714,7 +701,7 @@ For a complete `docker run` command including all env vars, see the xref:tinymce
714701

715702
[source,bash]
716703
----
717-
mysql --host=DB_HOST --user=ai_service --password=STRONG_PASSWORD \
704+
mysql --host=DB_HOST --user=ai_service --password=<strong-password> \
718705
ai_service --port=3306 -e "SELECT 1"
719706
----
720707

modules/ROOT/pages/tinymceai-on-premises-getting-started.adoc

Lines changed: 49 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,19 @@ This guide sets up a fully working local stack in roughly five minutes on any ma
1313
1414
The quick start is designed to validate the stack components before moving to a production deployment. Production engineers can review this section to understand the conceptual flow before continuing to xref:tinymceai-on-premises-production.adoc[Production deployment].
1515

16-
=== Prerequisites
16+
== Before you begin
17+
18+
Verify the following are installed and accessible:
19+
20+
[source,bash]
21+
----
22+
docker --version # 20.10+ required (or podman --version for Podman 4+)
23+
node --version # 18+ required
24+
npm --version
25+
----
26+
27+
Additionally, have the following credentials ready:
1728

18-
* Docker 20.10{plus} (or Podman 4{plus})
19-
* Node.js 18{plus} and npm (for the demo token server)
2029
* A TinyMCE license key and container registry credentials (from the Tiny account representative)
2130
* At least one LLM provider API key (OpenAI, Anthropic, or Google)
2231

@@ -37,18 +46,18 @@ For Docker:
3746

3847
[source,bash]
3948
----
40-
docker login -u 'TINY_REGISTRY_USERNAME' https://registry.containers.tiny.cloud
49+
docker login -u '<registry-username>' https://registry.containers.tiny.cloud
4150
# Docker prompts for the password; this avoids leaking it in shell history.
4251
----
4352

4453
For Podman:
4554

4655
[source,bash]
4756
----
48-
podman login -u 'TINY_REGISTRY_USERNAME' registry.containers.tiny.cloud
57+
podman login -u '<registry-username>' registry.containers.tiny.cloud
4958
----
5059

51-
Replace `TINY_REGISTRY_USERNAME` with the username supplied by the Tiny account representative. If credentials have not been received, contact `support@tiny.cloud`.
60+
Replace `<registry-username>` with the username supplied by the Tiny account representative. If credentials have not been received, contact `support@tiny.cloud`.
5261

5362
=== Pull the AI service image
5463

@@ -155,35 +164,21 @@ Both data layer containers (MySQL and Redis) should report `healthy` in the STAT
155164

156165
The AI service runs as a standalone container outside of the Docker Compose stack. This separation allows upgrading or reconfiguring the AI service without restarting the database and Redis.
157166

158-
Run from the same folder as the `.env` file:
167+
First, find the Docker Compose network name (Docker creates it from the folder name):
159168

160169
[source,bash]
161170
----
162-
set -a && source .env && set +a
171+
docker network ls --format '{{.Name}}' | grep default
172+
----
163173

164-
PROVIDERS='{'
165-
if [ -n "$OPENAI_API_KEY" ]; then
166-
PROVIDERS+='"openai":{"type":"openai","apiKeys":["'"$OPENAI_API_KEY"'"]}'
167-
fi
168-
if [ -n "$ANTHROPIC_API_KEY" ]; then
169-
[ "$PROVIDERS" != '{' ] && PROVIDERS+=','
170-
PROVIDERS+='"anthropic":{"type":"anthropic","apiKeys":["'"$ANTHROPIC_API_KEY"'"]}'
171-
fi
172-
if [ -n "$GOOGLE_API_KEY" ]; then
173-
[ "$PROVIDERS" != '{' ] && PROVIDERS+=','
174-
PROVIDERS+='"google":{"type":"google","apiKeys":["'"$GOOGLE_API_KEY"'"]}'
175-
fi
176-
PROVIDERS+='}'
177-
178-
# Resolve the compose network name (varies across Docker versions and folder names)
179-
NETWORK=$(docker network ls --format '{{.Name}}' | grep -E "^$(basename "$PWD" | tr '[:upper:]' '[:lower:]')[_-]default$" | head -1)
180-
if [ -z "$NETWORK" ]; then
181-
echo "ERROR: Could not find the Docker Compose network. Run 'docker network ls' and pass the network name with --network=<name>."
182-
exit 1
183-
fi
174+
Use the matching network name in `--network` below. Then run from the same folder as the `.env` file:
175+
176+
[source,bash]
177+
----
178+
set -a && source .env && set +a
184179
185180
docker run --init -d -p 8000:8000 \
186-
--network "$NETWORK" \
181+
--network <compose-network-name>_default \
187182
--name ai-service \
188183
-e LICENSE_KEY="$LICENSE_KEY" \
189184
-e ENVIRONMENTS_MANAGEMENT_SECRET_KEY="$MANAGEMENT_SECRET" \
@@ -193,13 +188,15 @@ docker run --init -d -p 8000:8000 \
193188
-e DATABASE_PASSWORD="$DB_PASSWORD" \
194189
-e DATABASE_DATABASE='ai_service' \
195190
-e REDIS_HOST='redis' \
196-
-e PROVIDERS="$PROVIDERS" \
191+
-e PROVIDERS='{"openai":{"type":"openai","apiKeys":["'"$OPENAI_API_KEY"'"]}}' \
197192
-e STORAGE_DRIVER='database' \
198193
-e ALLOWED_ORIGINS='http://localhost:3000' \
199194
-e ENABLE_METRIC_LOGS='true' \
200195
registry.containers.tiny.cloud/ai-service-tiny:latest
201196
----
202197

198+
TIP: The network name is typically `<foldername>_default` (e.g., `tinymce-ai-onpremise_default`). Run `docker network ls` to confirm. For multiple LLM providers, extend the `PROVIDERS` JSON: `{"openai":{...},"anthropic":{...}}`.
199+
203200
For Podman, replace `docker run` with `podman run` and use a Podman pod instead of a compose network. See xref:tinymceai-on-premises-production.adoc[Production deployment] for Podman-specific guidance. See xref:tinymceai-on-premises-production.adoc#_podman_deployment[Podman deployment] for a full example.
204201

205202
For native databases (the database runs on the host or in a managed service rather than in Docker), drop the `--network` flag and set `DATABASE_HOST=host.docker.internal` (Docker Desktop and Podman 4{plus}). On native Linux Docker, additionally pass `--add-host=host.docker.internal:host-gateway`.
@@ -218,6 +215,17 @@ Expected response:
218215
{"serviceName":"on-premises-http","uptime":5.123}
219216
----
220217

218+
.Successful boot log (`docker logs ai-service`)
219+
[source,text]
220+
----
221+
Connecting to database (driver=mysql host=mysql)
222+
Running migrations...
223+
Migrations complete: 32 tables ready
224+
Connecting to Redis (host=redis:6379)
225+
Redis connected
226+
Server is listening on port 8000.
227+
----
228+
221229
[WARNING]
222230
--
223231
If the container exits immediately, run `docker logs ai-service`. The most common causes are documented in the xref:tinymceai-on-premises-troubleshooting.adoc[Troubleshooting] guide. The top three are: malformed `LICENSE_KEY` (line breaks from word wrap), missing PostgreSQL schema, and JSON syntax error in `PROVIDERS`.
@@ -271,10 +279,8 @@ Create `package.json`:
271279

272280
Create `token-server.js`:
273281

274-
.Full token-server.js listing
275-
[%collapsible]
276-
====
277282
[source,javascript]
283+
.token-server.js
278284
----
279285
require('dotenv').config();
280286
const express = require('express');
@@ -350,7 +356,6 @@ app.listen(PORT, () => {
350356
console.log('AI Service: ' + AI_SERVICE_URL);
351357
});
352358
----
353-
====
354359

355360
=== Install and run
356361

@@ -493,3 +498,13 @@ For Kubernetes, scale the deployment to zero or delete it. Persistent volumes fo
493498
----
494499
kubectl delete deployment ai-service -n tinymce-ai
495500
----
501+
502+
== Next steps
503+
504+
The quick start validates the stack end-to-end on a single machine. To deploy for production, work through each guide in order:
505+
506+
. xref:tinymceai-on-premises-database.adoc[Database, Redis, and storage]: provision managed databases, configure TLS, and set up production-grade file storage.
507+
. xref:tinymceai-on-premises-providers.adoc[LLM providers]: configure explicit model catalogs and multi-provider routing.
508+
. xref:tinymceai-on-premises-jwt.adoc[JWT authentication]: build the production token endpoint with proper permissions and multi-tenant isolation.
509+
. xref:tinymceai-on-premises-frameworks.adoc[TinyMCE integration]: wire the editor to the production AI service with CORS and CSP.
510+
. xref:tinymceai-on-premises-production.adoc[Production deployment]: deploy to Kubernetes or ECS with TLS, scaling, and observability.

0 commit comments

Comments
 (0)