gitea获取diff更改 dockerfile更改 日志输出至文件
This commit is contained in:
@ -22,14 +22,20 @@ WORKDIR /app
|
||||
# 从构建阶段复制二进制文件
|
||||
COPY --from=builder /app/ai-code-review /app/
|
||||
|
||||
# 复制静态文件目录
|
||||
COPY --from=builder /app/static /app/static
|
||||
|
||||
# 创建默认配置文件到临时位置
|
||||
RUN echo 'port: 53321\nadmin_token: "token"\n\nauto_disable:\n enabled: true\n max_failures: 3\n reset_after: 30\n\nais: []\n\ngit: []' > /app/config.default.yaml
|
||||
|
||||
# 创建日志目录并设置权限
|
||||
RUN mkdir -p /app/logs && chmod 755 /app/logs
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 53321
|
||||
|
||||
# 设置卷挂载点
|
||||
VOLUME ["/app/config.yaml"]
|
||||
VOLUME ["/app/config.yaml", "/app/logs"]
|
||||
|
||||
# 运行应用,如果配置文件不存在则使用默认配置
|
||||
CMD ["sh", "-c", "if [ ! -f /app/config.yaml ]; then cp /app/config.default.yaml /app/config.yaml; fi && /app/ai-code-review"]
|
Reference in New Issue
Block a user