Files
CareerNexus/Dockerfile
T
RoyirinRosmontis a10442d78c CareerNexus 职联:岗位能力图谱构建与动态演化分析平台(挑战杯 XH-202621)
- 全链路:多源JD接入/清洗交叉验证/结构化抽取(星火+离线双通道)/时序知识图谱/新岗位发现/演化分析/人岗匹配/学习路径
- WebUI 五视图:驾驶舱/图谱工作台/岗位演化/匹配(单人+批量)/学习路径
- 设置中心(config.json)/Token鉴权/SQLite状态库/语义向量通道(BGE-M3本地或联网API)
- 71 个 pytest 用例;数据目录仅保留结构(.gitkeep),数据由 scripts/generate_dataset.py 复现
2026-08-03 13:15:35 +08:00

34 lines
1.3 KiB
Docker
Raw 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.
# CareerNexus 职联 —— 一体化镜像(默认 demo 模式,全程离线)
#
# 默认构建:轻量离线镜像(词表归一化,无模型权重)
# docker build -t careernexus .
#
# 语义增强变体:附带 sentence-transformers + BGE-M3 权重(镜像约 +4GB,
# 构建期需要联网下载依赖与权重;国内建议加 MODELSCOPE 源)
# docker build --build-arg INCLUDE_EMBED=1 -t careernexus:semantic .
FROM python:3.11-slim AS base
WORKDIR /app
# 先装依赖,利用镜像层缓存
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# ---- 可选:语义向量通道(BGE-M3) ----
ARG INCLUDE_EMBED=0
RUN if [ "$INCLUDE_EMBED" = "1" ]; then \
pip install --no-cache-dir sentence-transformers modelscope && \
modelscope download --model BAAI/bge-m3 --local_dir /app/models/bge-m3 ; \
fi
# 拷贝源码并生成数据集 + 构建图谱(保证容器内开箱即跑)
COPY . .
# 语义变体:把权重路径写入运行时设置(若本地已存在 models/ 目录则随源码一起拷贝)
RUN if [ "$INCLUDE_EMBED" = "1" ]; then \
printf '{\n "embed_model_path": "/app/models/bge-m3"\n}\n' > config.json ; \
fi && \
python scripts/generate_dataset.py && python scripts/run_demo.py
EXPOSE 9008
CMD ["python", "main.py"]