From bd841e539f32c8be9e42556a229e386006216b0c Mon Sep 17 00:00:00 2001 From: 3377 <35794406@qq.com> Date: Tue, 17 Dec 2024 17:30:19 +0800 Subject: [PATCH] fix: Fix version file copy in production Dockerfile --- .gitignore | 10 ++++++++++ Dockerfile | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..31f94bc --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +# 配置文件(可能包含敏感信息) +config/config.yaml + +# 运行时数据 +data/sent_items.txt +data/stats.yaml + +# 其他 +.DS_Store +*.log \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 074983d..e98f49a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,8 +26,8 @@ COPY --from=builder /build/bot /app/bot # 创建必要的目录 RUN mkdir -p /app/config /app/data -# 复制version文件到config目录 -COPY version /app/config/version +# 复制version文件到config目录(从构建阶段复制) +COPY --from=builder /build/config/version /app/config/version # 复制entrypoint脚本 COPY entrypoint.sh /app/entrypoint.sh