模块拆分 init

This commit is contained in:
2026-08-27 14:53:22 +08:00
parent e6ddea33a2
commit 3ea59551db
15 changed files with 2191 additions and 1399 deletions
+33 -36
View File
@@ -1,23 +1,41 @@
# ============================================
# 环境变量模板 — 独立部署版
# 环境变量模板 — 复用服务器已有基础设施
# ============================================
# 复制为 .env 并修改配置
# 复制为 .env 并按服务器实际服务地址修改
# 数据库
DB_HOST=postgres
# API 对外端口
MOLDINSIGHT_PORT=8000
INVENTORY_PORT=8001
# 数据库(服务器已部署)
DB_HOST=127.0.0.1
DB_PORT=5432
DB_NAME=moldinsight
DB_USER=moldinsight_user
DB_PASSWORD=moldinsight_password
DB_USER=moldinsight
DB_PASSWORD=change-me
# Redis
REDIS_HOST=redis
# Redis(服务器已部署)
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_DB=0
# MinIO (RustFS 兼容存储)
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin
# RustFS / MinIO 兼容对象存储(服务器已部署)
RUSTFS_ENDPOINT=http://127.0.0.1:9000
RUSTFS_ACCESS_KEY=change-me
RUSTFS_SECRET_KEY=change-me
RUSTFS_TIMEOUT=30
RUSTFS_PRESIGNED_URL_EXPIRES=3600
# 服务配置
HOST=0.0.0.0
DEBUG=false
UPLOAD_DIR=./uploads
MAX_FILE_SIZE=104857600
ALLOWED_EXTENSIONS=.stp,.step,.stp.gz
POINTCLOUD_SAMPLE_COUNT=10000
MESH_QUALITY=high
PARALLEL_PROCESSING=true
# 认证
SECRET_KEY=your-secret-key-change-in-production-min-32-chars
@@ -30,35 +48,14 @@ ADMIN_PASSWORD=change-this-to-a-secure-password
ADMIN_EMAIL=admin@gemold.com
ADMIN_FULL_NAME=系统管理员
# 端口
MOLDINSIGHT_PORT=8000
INVENTORY_PORT=8001
# FreeCAD 验证(可选)
ENABLE_FREECAD_VERIFICATION=false
FREECAD_VERIFICATION_TIMEOUT=120
# 文件上传
UPLOAD_DIR=./uploads
MAX_FILE_SIZE=104857600
ALLOWED_EXTENSIONS=.stp,.step,.stp.gz
# 几何处理
POINTCLOUD_SAMPLE_COUNT=10000
MESH_QUALITY=high
PARALLEL_PROCESSING=true
# RustFS 对象存储
RUSTFS_ENDPOINT=http://minio:9000
RUSTFS_ACCESS_KEY=minioadmin
RUSTFS_SECRET_KEY=minioadmin
RUSTFS_TIMEOUT=30
RUSTFS_PRESIGNED_URL_EXPIRES=3600
# LLM (可选)
# LLM(可选)
LLM_ENABLED=false
LLM_API_URL=https://api.openai.com/v1
LLM_API_KEY=sk-your-api-key
LLM_MODEL=gpt-4o-mini
LLM_TIMEOUT=60
LLM_MAX_TOKENS=2000
# FreeCAD 验证 (可选)
ENABLE_FREECAD_VERIFICATION=false
FREECAD_VERIFICATION_TIMEOUT=120
-165
View File
@@ -1,165 +0,0 @@
services:
postgres:
image: postgres:15
container_name: gemold_postgres
environment:
POSTGRES_DB: ${DB_NAME:-moldinsight}
POSTGRES_USER: ${DB_USER:-moldinsight_user}
POSTGRES_PASSWORD: ${DB_PASSWORD:-moldinsight_password}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-moldinsight_user} -d ${DB_NAME:-moldinsight}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- gemold_network
redis:
image: redis:7-alpine
container_name: gemold_redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- gemold_network
minio:
image: minio/minio:latest
container_name: gemold_minio
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:-minioadmin}
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:-minioadmin}
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
restart: unless-stopped
networks:
- gemold_network
moldinsight:
build:
context: ..
dockerfile: deploy/Dockerfile.moldinsight
image: gemold-moldinsight:latest
container_name: gemold_moldinsight
ports:
- "${MOLDINSIGHT_PORT:-8000}:8000"
environment:
HOST: 0.0.0.0
PORT: "8000"
DB_HOST: postgres
DB_PORT: "5432"
DB_NAME: ${DB_NAME:-moldinsight}
DB_USER: ${DB_USER:-moldinsight_user}
DB_PASSWORD: ${DB_PASSWORD:-moldinsight_password}
REDIS_HOST: redis
REDIS_PORT: "6379"
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
RUSTFS_ENDPOINT: http://minio:9000
RUSTFS_ACCESS_KEY: ${MINIO_ACCESS_KEY:-minioadmin}
RUSTFS_SECRET_KEY: ${MINIO_SECRET_KEY:-minioadmin}
SECRET_KEY: ${SECRET_KEY:-change-me-in-production}
ADMIN_USERNAME: ${ADMIN_USERNAME:-admin}
ADMIN_PASSWORD: ${ADMIN_PASSWORD:-admin123}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
minio:
condition: service_healthy
restart: unless-stopped
profiles:
- full
- moldinsight
networks:
- gemold_network
moldinsight-celery:
build:
context: ..
dockerfile: deploy/Dockerfile.celery
container_name: gemold_celery
environment:
DB_HOST: postgres
DB_PORT: "5432"
DB_NAME: ${DB_NAME:-moldinsight}
DB_USER: ${DB_USER:-moldinsight_user}
DB_PASSWORD: ${DB_PASSWORD:-moldinsight_password}
REDIS_HOST: redis
REDIS_PORT: "6379"
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
RUSTFS_ENDPOINT: http://minio:9000
RUSTFS_ACCESS_KEY: ${MINIO_ACCESS_KEY:-minioadmin}
RUSTFS_SECRET_KEY: ${MINIO_SECRET_KEY:-minioadmin}
RUSTFS_TIMEOUT: ${RUSTFS_TIMEOUT:-30}
depends_on:
- moldinsight
restart: unless-stopped
profiles:
- full
- moldinsight
networks:
- gemold_network
inventory:
build:
context: ..
dockerfile: deploy/Dockerfile.inventory
image: gemold-inventory:latest
container_name: gemold_inventory
ports:
- "${INVENTORY_PORT:-8001}:8001"
environment:
HOST: 0.0.0.0
PORT: "8001"
DB_HOST: postgres
DB_PORT: "5432"
DB_NAME: ${DB_NAME:-moldinsight}
DB_USER: ${DB_USER:-moldinsight_user}
DB_PASSWORD: ${DB_PASSWORD:-moldinsight_password}
REDIS_HOST: redis
REDIS_PORT: "6379"
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
SECRET_KEY: ${SECRET_KEY:-change-me-in-production}
ADMIN_USERNAME: ${ADMIN_USERNAME:-admin}
ADMIN_PASSWORD: ${ADMIN_PASSWORD:-admin123}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
profiles:
- full
- inventory
networks:
- gemold_network
volumes:
postgres_data:
driver: local
minio_data:
driver: local
networks:
gemold_network:
driver: bridge