Files
cjw 2fd1b3da21 🐛 fix(deploy): 修干净机器首次构建两处必挂——.dockerignore 排除 deploy/ + celery 并行构建依赖
部署机首次 docker compose up -d 实测暴露:

- .dockerignore 自"重写独立dockerfile"起排除整个 deploy/,而
  Dockerfile.frontend COPY deploy/nginx/frontend.conf、Dockerfile.moldinsight
  COPY deploy/requirements-*.txt → COPY not found。历史一直有旧镜像兜底未暴露;
  BuildKit 不支持重包含被排除目录的子文件,直接移除该行
- Dockerfile.celery FROM gemold-backend:latest 在 compose 并行构建下引用
  尚不存在的本地镜像必挂 → 删除 Dockerfile.celery,moldinsight-celery 改为
  与 API 服务同一 build 声明 + 同一 gemold-backend:latest tag(compose 去重
  只构建一次),celery 仅以 command: 覆盖启动 worker,参数语义不变
- build.sh/.bat 移除 gemold-celery 构建步骤;OPERATIONS / OCC_THROUGHPUT /
  TECH_DEBT / .env.example 的 Dockerfile.celery 指向同步改写;STATUS 补录

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-24 16:18:44 +08:00

30 lines
880 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# ============================================
# 构建脚本 — 独立部署
# ============================================
set -e
cd "$(dirname "$0")/.."
echo "=== 构建基础镜像 ==="
docker build -t gemold-base:latest -f deploy/Dockerfile.base .
echo ""
echo "=== 构建统一后端镜像 ==="
docker build -t gemold-backend:latest -f deploy/Dockerfile.moldinsight .
echo ""
echo ""
echo "=== 构建前端镜像 (Nginx 静态站点) ==="
docker build -t gemold-frontend:latest -f deploy/Dockerfile.frontend .
echo ""
echo "=== 全部构建完成 ==="
echo ""
echo "启动 unified 默认栈(前端 + backend + celery):"
echo " docker compose up -d"
echo ""
echo "按文件名切换模式(旧 --profile 写法已失效):"
echo " docker compose -f docker-compose.moldinsight.yml up -d"
echo " docker compose -f docker-compose.inventory.yml up -d"