fix(docker): 复制 templates 和 static 目录到运行时镜像

- 修复容器启动时找不到模板文件导致崩溃的问题
- 添加 COPY 指令复制 templates/ 和 static/ 目录
- 验证容器可正常启动并通过健康检查
This commit is contained in:
OpenClaw Agent
2026-02-12 00:59:46 +08:00
parent 69814a3822
commit ebe9d61665

View File

@@ -49,6 +49,10 @@ WORKDIR /app
COPY --from=builder /app/sms-receiver . COPY --from=builder /app/sms-receiver .
COPY --from=builder /app/config.example.yaml config.yaml COPY --from=builder /app/config.example.yaml config.yaml
# 复制运行时需要的目录(模板和静态资源)
COPY --from=builder /app/templates ./templates
COPY --from=builder /app/static ./static
# 创建数据目录并设置权限 # 创建数据目录并设置权限
RUN mkdir -p /app/data /app/logs && \ RUN mkdir -p /app/data /app/logs && \
chown -R appuser:appuser /app chown -R appuser:appuser /app