docs(cloud-image): add cloud-agnostic image packaging scripts

Add scripts and docs for packaging WeKnora into cloud images (AMI,
custom images, snapshots) so users can distribute one-click deployable
templates on any cloud provider.

- scripts/cloud-image/: cloud-agnostic prepare/cleanup/firstboot scripts
  plus systemd units. Downloads only the 4 runtime files needed by the
  compose stack (~100KB) instead of cloning the full repo, and pins to
  any git ref via WEKNORA_REF for reproducible builds.
- firstboot.sh randomizes DB/Redis/JWT/AES secrets on first boot,
  writes credentials to /root/weknora-credentials.txt and self-removes.
- docs/cloud-image/: per-platform packaging guides. Includes a guide
  for Tencent Cloud Lighthouse / CVM covering image creation, sharing,
  and marketplace listing.

Default-on services match the unprofiled compose stack (frontend, app,
docreader, postgres, redis); optional services (qdrant, milvus,
neo4j, langfuse, etc.) remain opt-in via compose profiles to keep the
image size small.
This commit is contained in:
wizardchen
2026-05-11 11:56:03 +08:00
committed by lyingbug
parent 7c0964bb95
commit afd7d1fdf8
8 changed files with 652 additions and 0 deletions
@@ -0,0 +1,16 @@
[Unit]
Description=WeKnora first-boot initialization (runs once)
After=docker.service network-online.target
Requires=docker.service
Wants=network-online.target
Before=weknora.service
ConditionPathExists=/usr/local/sbin/weknora-firstboot.sh
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/weknora-firstboot.sh
RemainAfterExit=no
TimeoutStartSec=900
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,16 @@
[Unit]
Description=WeKnora (docker compose)
Requires=docker.service
After=docker.service network-online.target weknora-firstboot.service
Wants=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/opt/WeKnora
ExecStart=/usr/bin/docker compose up -d
ExecStop=/usr/bin/docker compose down
TimeoutStartSec=600
[Install]
WantedBy=multi-user.target