Update Dockerfile to create both data and logs directories; enhance logger to handle directory and file creation errors gracefully. Log warnings for permission issues without blocking application startup.

This commit is contained in:
2025-10-31 09:33:05 +08:00
parent f96a69e846
commit c9ccb3435d
2 changed files with 35 additions and 13 deletions

View File

@@ -31,8 +31,8 @@ RUN pnpm i
# 复制项目文件
COPY . .
# 创建数据目录并设置权限
RUN mkdir -p /app/data && \
# 创建数据目录和日志目录并设置权限
RUN mkdir -p /app/data /app/logs && \
chown -R node:node /app
# 切换到非root用户