e65dcc2d39
约定"容器内部端口无所谓,重要的是宿主机端口;前端 = 10003"。 - .env.example 端口段重写:移除冗余 HOST/PORT(uvicorn 命令硬编码, 无人读 env)+ 移除误导注释;FRONTEND_PORT/BACKEND_PORT/MOLDINSIGHT_PORT 默认 10003,INVENTORY_PORT 默认 10004 - docker-compose.yml frontend 默认 80→10003、backend 8000→10003,删除 backend service 内冗余 HOST/PORT env - docker-compose.moldinsight.yml / docker-compose.inventory.yml 默认 端口同步 - DEPLOY_PORT §3 / PORT_CONFIG §1 §2 端口映射示例同步 - STATUS 补录 验证:yaml 渲染端口映射 unified frontend 10003→80、backend 10003→8000, moldinsight 10003→8000,inventory 10004→8001。 Co-Authored-By: Claude Code <noreply@anthropic.com>
58 lines
2.0 KiB
YAML
58 lines
2.0 KiB
YAML
# geMoldInsight — inventory-only 模式
|
|
#
|
|
# 一键启动:
|
|
# docker compose -f docker-compose.inventory.yml up -d
|
|
#
|
|
# 服务清单:仅 inventory 后端
|
|
# 不含前端、不含 moldinsight、不含 Celery worker。
|
|
#
|
|
# 基础设施:仅依赖 PostgreSQL + Redis;不依赖 RustFS / MinIO 对象存储,
|
|
# 不挂 uploads/html 命名卷(inventory 无文件分析链路)。
|
|
# 注意:服务未声明 profiles(避免裸 up 报 "no service selected"),
|
|
# 模式切换唯一入口是 -f 文件名。
|
|
|
|
# ---------------------------------------------------------------
|
|
# 公共环境变量(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:-10004}: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
|
|
networks:
|
|
- gemold_network
|
|
|
|
networks:
|
|
gemold_network:
|
|
name: gemold_network
|
|
driver: bridge |