feat(ocr): 新增本地 OCR sidecar
This commit is contained in:
@@ -765,6 +765,7 @@ main() {
|
||||
|
||||
wait_service_healthy mysql "MySQL"
|
||||
wait_service_healthy redis "Redis"
|
||||
wait_service_healthy ocr "OCR sidecar"
|
||||
wait_service_healthy caddy "Caddy"
|
||||
ensure_mysql_backup_user
|
||||
reset_database
|
||||
|
||||
+8
-1
@@ -26,6 +26,7 @@ MYSQL_PORT="${DEV_MYSQL_PORT:-13306}"
|
||||
REDIS_PORT="${DEV_REDIS_PORT:-16379}"
|
||||
MINIO_API_PORT="${DEV_MINIO_API_PORT:-19090}"
|
||||
MINIO_CONSOLE_PORT="${DEV_MINIO_CONSOLE_PORT:-19091}"
|
||||
OCR_PORT="${DEV_OCR_PORT:-18787}"
|
||||
BACKEND_HEALTH_URL="${DEV_BACKEND_HEALTH_URL:-http://127.0.0.1:${BACKEND_PORT}/health}"
|
||||
FRONTEND_HEALTH_URL="${DEV_FRONTEND_HEALTH_URL:-http://127.0.0.1:${FRONTEND_PORT}/}"
|
||||
DISTRIBUTION_HEALTH_URL="${DEV_DISTRIBUTION_HEALTH_URL:-http://127.0.0.1:${DISTRIBUTION_PORT}/}"
|
||||
@@ -107,6 +108,8 @@ show_help() {
|
||||
MinIO API 宿主机映射端口
|
||||
DEV_MINIO_CONSOLE_PORT=19091
|
||||
MinIO 控制台宿主机映射端口
|
||||
DEV_OCR_PORT=18787
|
||||
OCR sidecar 宿主机映射端口
|
||||
DEV_BACKEND_HEALTH_URL=http://127.0.0.1:18088/health
|
||||
后端健康检查地址
|
||||
DEV_FRONTEND_HEALTH_URL=http://127.0.0.1:5189/
|
||||
@@ -527,6 +530,7 @@ start_backend() {
|
||||
export MYSQL_DSN="hfb:secret@tcp(127.0.0.1:${MYSQL_PORT})/${MYSQL_DATABASE}?charset=utf8mb4&parseTime=True&loc=Local"
|
||||
export REDIS_ADDR="127.0.0.1:${REDIS_PORT}"
|
||||
export STORAGE_ENDPOINT="http://localhost:${MINIO_API_PORT}"
|
||||
export OCR_SERVICE_URL="${OCR_SERVICE_URL:-http://127.0.0.1:${OCR_PORT}}"
|
||||
go run ./cmd/api
|
||||
) &
|
||||
BACKEND_PID="$!"
|
||||
@@ -715,17 +719,20 @@ main() {
|
||||
ensure_port_free "${REDIS_PORT}" "Redis" hfb-redis
|
||||
ensure_port_free "${MINIO_API_PORT}" "MinIO API" hfb-minio
|
||||
ensure_port_free "${MINIO_CONSOLE_PORT}" "MinIO 控制台" hfb-minio
|
||||
ensure_port_free "${OCR_PORT}" "OCR sidecar" hfb-ocr
|
||||
|
||||
log "启动开发依赖:MySQL、Redis、MinIO"
|
||||
log "启动开发依赖:MySQL、Redis、MinIO、OCR sidecar"
|
||||
export DEV_MYSQL_PORT="${MYSQL_PORT}"
|
||||
export DEV_REDIS_PORT="${REDIS_PORT}"
|
||||
export DEV_MINIO_API_PORT="${MINIO_API_PORT}"
|
||||
export DEV_MINIO_CONSOLE_PORT="${MINIO_CONSOLE_PORT}"
|
||||
export DEV_OCR_PORT="${OCR_PORT}"
|
||||
docker compose -f "${COMPOSE_FILE}" up -d
|
||||
|
||||
wait_container_healthy hfb-mysql "MySQL"
|
||||
wait_container_healthy hfb-redis "Redis"
|
||||
wait_container_healthy hfb-minio "MinIO"
|
||||
wait_container_healthy hfb-ocr "OCR sidecar"
|
||||
|
||||
reset_database
|
||||
run_migrations
|
||||
|
||||
Reference in New Issue
Block a user