-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migrate to uber-go/zap and support loki stack to collect log fi…
…les (#130) * chore: migrate to uber-go/zap and support loki stack to collect log files * feat: allow setting log file path * feat: added complete settings for promtail and tweaked docker-compose settings * chore: update deps * chore: cleanup dockerfile * fix: logrus field incorrectly handled
- Loading branch information
1 parent
282890e
commit 0c19cff
Showing
51 changed files
with
798 additions
and
431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,31 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# 设定构建步骤所使用的来源镜像为基于 Debian 发行版的 Go 1.20 版本镜像 | ||
# --- builder --- | ||
|
||
FROM golang:1.20 as builder | ||
|
||
# 设定 Go 使用 模块化依赖 管理方式:GO111MODULE | ||
RUN GO111MODULE=on | ||
|
||
# 创建路径 /app | ||
RUN mkdir /app | ||
|
||
# 复制当前目录下 insights-bot 到 /app/insights-bot | ||
COPY . /app/insights-bot | ||
|
||
# 切换到 /app/insights-bot 目录 | ||
WORKDIR /app/insights-bot | ||
|
||
# Build | ||
RUN go env | ||
RUN go env -w CGO_ENABLED=0 | ||
RUN go mod download | ||
RUN go build -a -o "release/insights-bot" "github.com/nekomeowww/insights-bot/cmd/insights-bot" | ||
|
||
# 设定运行步骤所使用的镜像为基于 Debian 发行版镜像 | ||
# --- runner --- | ||
FROM debian as runner | ||
|
||
RUN apt update && apt upgrade -y && apt install -y ca-certificates | ||
RUN apt update && apt upgrade -y && apt install -y ca-certificates && update-ca-certificates | ||
|
||
COPY --from=builder /app/insights-bot/release/insights-bot /usr/local/bin/ | ||
|
||
# Health check endpoint | ||
ENV LOG_FILE_PATH /var/log/insights-bot/insights-bot.log | ||
|
||
EXPOSE 7069 | ||
|
||
# 入点是编译好的应用程序 | ||
CMD [ "/usr/local/bin/insights-bot" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.