第三个页签(与海选审核/演出配置平级),只读查看每个点位集里各点的真实
位置/朝向,配 move.to/camera.focus 时对照用,不必回 Unity 翻 json。
- pointview.js: 独立白模点位查看器(按 kind 上色/朝向箭头/悬停坐标/侧栏清单);
有底图则把正交俯视真实场景图当画布底图、点位按 shot.bounds 线性投上去
(像素级对齐家具),带显隐开关;无底图回退黑底白模。
- app.py: /api/pointsets 给有底图的点位集附 shot{url,bounds};新增
/sceneshot/{name}.png 路由(防目录穿越)。
- Dockerfile/compose: 加 STORY_SCENESHOTS_DIR(/sceneshots) env + 挂载点与注释。
底图由 SGame 仓新增 Editor 工具「剧情场景俯视抓拍」产出
({name}.png + {name}.shot.json,map-local 覆盖范围)。
39 lines
1.9 KiB
Docker
39 lines
1.9 KiB
Docker
# Story 事件协作 Web 编辑器(M6 部署)。
|
||
# 构建上下文 = tools/event_authoring (需含 ir_core / ir_dictionary.json / web)。
|
||
# docker build -f web/Dockerfile -t story-event-web .
|
||
# 或用 web/docker-compose.yml 一键起。
|
||
FROM python:3.12-slim
|
||
|
||
WORKDIR /app
|
||
|
||
# 仅装后端运行依赖(编译器是纯 Python 标准库,无需额外包)
|
||
# PIP_INDEX_URL 默认官方源(可移植);国内构建可 --build-arg 指向清华等镜像加速。
|
||
ARG PIP_INDEX_URL=https://pypi.org/simple
|
||
COPY web/requirements.txt ./web/requirements.txt
|
||
RUN pip install --no-cache-dir --index-url ${PIP_INDEX_URL} -r web/requirements.txt
|
||
|
||
# 编译/校验内核 + 外置词典 + 后端 + 前端
|
||
COPY ir_core ./ir_core
|
||
COPY ir_dictionary.json ./ir_dictionary.json
|
||
COPY web ./web
|
||
|
||
# SQLite 持久化目录(挂卷到此);点位集挂载到 /pointsets(只读)。
|
||
# 注意:镜像里不埋任何口令默认值。STORY_WEB_USERS(名字:口令,…)必须运行时注入,
|
||
# 未配置时 app 启动即退出(拒绝弱口令裸奔)。
|
||
ENV STORY_DB_PATH=/data/story_events.db \
|
||
STORY_POINTSETS_DIR=/pointsets \
|
||
STORY_SCENESHOTS_DIR=/sceneshots
|
||
RUN mkdir -p /data /pointsets /sceneshots
|
||
|
||
EXPOSE 8787
|
||
WORKDIR /app/web
|
||
|
||
# 探测首页(静态,恒 200):/api/* 无凭证会 401 且 urlopen 会抛异常,故改打 / 。
|
||
HEALTHCHECK --interval=30s --timeout=4s --start-period=8s --retries=3 \
|
||
CMD python -c "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8787/',timeout=3).status==200 else 1)"
|
||
|
||
# STORY_WEB_RELOAD=1 时启用代码热重载(配合把 git 同步仓库整目录挂到 /app:
|
||
# 后端 app.py/db.py/ir_core 改动 push 后自动生效,无需重建镜像;仅改依赖/环境变量仍需重建)。
|
||
# 无该变量时与原行为一致(生产默认不开监视)。
|
||
CMD ["sh", "-c", "exec uvicorn app:app --host 0.0.0.0 --port 8787 ${STORY_WEB_RELOAD:+--reload --reload-dir /app}"]
|