4 核 8G 同时跑协会站点、PlayEdu 和估价智能体,并让门户专家页底色透出页面背景。 Co-authored-by: Cursor <cursoragent@cursor.com>
70 lines
2.5 KiB
Bash
Executable File
70 lines
2.5 KiB
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
TAG="${IMAGE_TAG:-20261123}"
|
|
if [[ -f "$ROOT/deploy/IMAGE_TAG" ]]; then
|
|
TAG="$(tr -d '[:space:]' < "$ROOT/deploy/IMAGE_TAG")"
|
|
fi
|
|
OUT="$ROOT/deploy/dist"
|
|
STAGE="$OUT/gsfdc-bundle"
|
|
rm -rf "$STAGE"
|
|
mkdir -p "$STAGE/nginx" "$STAGE/mysql/init" "$STAGE/certs" "$STAGE/certbot"
|
|
|
|
cp "$ROOT/deploy/docker-compose.yml" "$ROOT/deploy/.env.example" "$STAGE/"
|
|
cp "$ROOT/deploy/IMAGE_TAG" "$STAGE/" 2>/dev/null || echo "$TAG" > "$STAGE/IMAGE_TAG"
|
|
cp "$ROOT/deploy/"*.sh "$STAGE/"
|
|
cp "$ROOT/deploy/nginx/"*.template "$STAGE/nginx/"
|
|
cp "$ROOT/deploy/mysql/my.cnf" "$STAGE/mysql/"
|
|
mkdir -p "$STAGE/mysql/init"
|
|
cp "$ROOT/deploy/mysql/init/02-playedu.sh" "$STAGE/mysql/init/"
|
|
cp "$ROOT/deploy/README.md" "$STAGE/" 2>/dev/null || true
|
|
|
|
echo "放入 Dify 编排和免登补丁,不带本机数据和密钥"
|
|
mkdir -p "$STAGE/dify/api/controllers/console/auth" \
|
|
"$STAGE/dify/api/services/rag_pipeline"
|
|
rsync -a \
|
|
--exclude volumes \
|
|
--exclude tests \
|
|
--exclude certbot \
|
|
--exclude '*.png' \
|
|
--exclude .env \
|
|
--exclude .gsrea_sso_secret \
|
|
--exclude docker-compose.override.yaml \
|
|
"$ROOT/demo-dify/dify/docker/" "$STAGE/dify/docker/"
|
|
cp "$ROOT/deploy/dify/docker-compose.gsfdc.yml" "$STAGE/dify/docker/docker-compose.gsfdc.yml"
|
|
cp "$ROOT/demo-dify/dify/api/controllers/console/auth/gsrea_sso.py" \
|
|
"$STAGE/dify/api/controllers/console/auth/"
|
|
cp "$ROOT/demo-dify/dify/api/controllers/console/__init__.py" \
|
|
"$STAGE/dify/api/controllers/console/"
|
|
cp "$ROOT/demo-dify/dify/api/services/recommended_app_catalog_gateway.py" \
|
|
"$STAGE/dify/api/services/"
|
|
cp "$ROOT/demo-dify/dify/api/services/rag_pipeline/rag_pipeline.py" \
|
|
"$STAGE/dify/api/services/rag_pipeline/"
|
|
|
|
echo "打包镜像(协会站点、继续教育、Dify)"
|
|
docker save \
|
|
"gsfdc-server:${TAG}" \
|
|
"gsfdc-portal:${TAG}" \
|
|
"gsfdc-web:${TAG}" \
|
|
"gsfdc-playedu:${TAG}" \
|
|
mysql:8.0 \
|
|
redis:7.4-alpine \
|
|
minio/minio:latest \
|
|
langgenius/dify-api:1.19.0-amd64 \
|
|
langgenius/dify-web:1.19.0-amd64 \
|
|
langgenius/dify-plugin-daemon:0.6.14-amd64 \
|
|
langgenius/dify-sandbox:0.2.15-amd64 \
|
|
langgenius/dify-agent-backend:1.19.0-amd64 \
|
|
langgenius/dify-agent-local-sandbox:1.19.0-amd64 \
|
|
postgres:15-alpine-amd64 \
|
|
redis:6-alpine-amd64 \
|
|
nginx:1.27-amd64 \
|
|
busybox:1.36-amd64 \
|
|
ubuntu/squid:latest-amd64 \
|
|
weaviate:1.39.13-amd64 \
|
|
| gzip -1 > "$STAGE/images.tar.gz"
|
|
|
|
tar -C "$OUT" -cf "$OUT/gsfdc-bundle-${TAG}.tar" gsfdc-bundle
|
|
ls -lh "$STAGE/images.tar.gz" "$OUT/gsfdc-bundle-${TAG}.tar"
|
|
echo "离线包 $OUT/gsfdc-bundle-${TAG}.tar"
|