📦 build(deploy): Compose 按部署模式拆分三文件——换文件名即换模式一键部署
- docker-compose.yml(unified 默认入口)/ docker-compose.moldinsight.yml / docker-compose.inventory.yml 三文件一一对应三种部署模式,profiles 字段保留(--profile 旧命令双保险可用) - 修复两个既有部署隐患:moldinsight-only 场景 celery depends_on 悬空;moldinsight service image 统一为 gemold-backend:latest 与 Dockerfile.celery FROM 对齐(废弃 gemold-moldinsight tag) - gemold_network / uploads_data / html_data 固定 name 命名;inventory-only 不声明卷避免空卷;每文件内 x-base-env anchor 收敛重复 environment(SECRET_KEY/ADMIN_PASSWORD fail-fast 保留) - 文档同步 11 处:DEPLOYMENT §1.1 一键部署总表 + §2 三模式命令、LINUX_SETUP §6/§11、README、OPERATIONS §4、build.sh/.bat 提示、PORT_CONFIG / DEPLOY_PORT / STORAGE_SETUP / frontend/README - STATUS.md 补 2026-09-24 批次日志 验证:三文件 YAML 结构静态校验通过;5 个 service environment 键与拆分前逐一比对零丢失(39/39、34/34、39/39、34/34、20/20) Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
# geMoldInsight — inventory-only 模式
|
||||
#
|
||||
# 一键启动:
|
||||
# docker compose -f docker-compose.inventory.yml up -d
|
||||
# 等价命令(profile 双保险):
|
||||
# docker compose --profile inventory up -d
|
||||
#
|
||||
# 服务清单:仅 inventory 后端
|
||||
# 不含前端、不含 moldinsight、不含 Celery worker。
|
||||
#
|
||||
# 基础设施:仅依赖 PostgreSQL + Redis;不依赖 RustFS / MinIO 对象存储,
|
||||
# 不挂 uploads/html 命名卷(inventory 无文件分析链路)。
|
||||
|
||||
# ---------------------------------------------------------------
|
||||
# 公共环境变量(inventory 子集:DB / Redis / 认证 / 启动参数)
|
||||
# ---------------------------------------------------------------
|
||||
x-inventory-env: &inventory_env
|
||||
DB_HOST: ${DB_HOST}
|
||||
DB_PORT: ${DB_PORT:-5432}
|
||||
DB_NAME: ${DB_NAME:-moldinsight}
|
||||
DB_USER: ${DB_USER}
|
||||
DB_PASSWORD: ${DB_PASSWORD}
|
||||
REDIS_HOST: ${REDIS_HOST}
|
||||
REDIS_PORT: ${REDIS_PORT:-6379}
|
||||
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
|
||||
SECRET_KEY: ${SECRET_KEY:?SECRET_KEY 未配置:请在 .env 中设置}
|
||||
ALGORITHM: ${ALGORITHM:-HS256}
|
||||
ACCESS_TOKEN_EXPIRE_MINUTES: ${ACCESS_TOKEN_EXPIRE_MINUTES:-1440}
|
||||
DEBUG: ${DEBUG:-false}
|
||||
SERVE_FRONTEND_STATIC: ${SERVE_FRONTEND_STATIC:-false}
|
||||
|
||||
services:
|
||||
inventory:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: deploy/Dockerfile.inventory
|
||||
image: gemold-inventory:latest
|
||||
container_name: gemold_inventory
|
||||
command: ["python", "-m", "uvicorn", "entrypoints.inventory:app", "--host", "0.0.0.0", "--port", "8001"]
|
||||
ports:
|
||||
- "${INVENTORY_PORT:-8001}:8001"
|
||||
environment:
|
||||
<<: *inventory_env
|
||||
HOST: 0.0.0.0
|
||||
PORT: "8001"
|
||||
ADMIN_USERNAME: ${ADMIN_USERNAME:-admin}
|
||||
ADMIN_PASSWORD: ${ADMIN_PASSWORD:?ADMIN_PASSWORD 未配置:请在 .env 中设置}
|
||||
ADMIN_EMAIL: ${ADMIN_EMAIL:-admin@gemold.com}
|
||||
ADMIN_FULL_NAME: ${ADMIN_FULL_NAME:-系统管理员}
|
||||
AUTO_MIGRATE: ${AUTO_MIGRATE:-true}
|
||||
restart: unless-stopped
|
||||
profiles:
|
||||
- inventory
|
||||
networks:
|
||||
- gemold_network
|
||||
|
||||
networks:
|
||||
gemold_network:
|
||||
name: gemold_network
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user