Skip to content

Commit

Permalink
更新dockerfile,更新readme文件
Browse files Browse the repository at this point in the history
Signed-off-by: jikun.zhang <[email protected]>
  • Loading branch information
jikun.zhang committed Jul 28, 2023
1 parent 2fcde8e commit b0cc463
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 369 deletions.
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
FROM golang:1.16-alpine3.12 as builder
FROM golang:1.20.6-alpine3.18 as builder

WORKDIR $GOPATH/src/github.com/feiyu563/PrometheusAlert

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
apk update && apk upgrade && \
RUN apk update && \
apk add --no-cache gcc g++ sqlite-libs make git

ENV GO111MODULE on
Expand All @@ -15,17 +14,17 @@ COPY . $GOPATH/src/github.com/feiyu563/PrometheusAlert
RUN make build

# -----------------------------------------------------------------------------
FROM alpine:3.12
FROM alpine:3.18

LABEL maintainer="jikun.zhang"

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
apk add tzdata && \
RUN apk update && \
apk add --no-cache tzdata && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone && \
apk del tzdata && \
mkdir -p /app/logs && \
apk update && apk upgrade && apk add --no-cache sqlite-libs curl sqlite
apk add --no-cache sqlite-libs curl sqlite

HEALTHCHECK --start-period=10s --interval=20s --timeout=3s --retries=3 \
CMD curl -fs http://localhost:8080/health || exit 1
Expand Down
4 changes: 2 additions & 2 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ curl http://localhost:8080/health

```
#打开PrometheusAlert releases页面,根据需要选择需要的版本下载到本地解压并进入解压后的目录
如linux版本(https://github.com/feiyu563/PrometheusAlert/releases/download/v4.7/linux.zip)
如linux版本(https://github.com/feiyu563/PrometheusAlert/releases/download/v4.9/linux.zip)
# wget https://github.com/feiyu563/PrometheusAlert/releases/download/v4.7/linux.zip && unzip linux.zip &&cd linux/
# wget https://github.com/feiyu563/PrometheusAlert/releases/download/v4.9/linux.zip && unzip linux.zip &&cd linux/
#运行PrometheusAlert
# ./PrometheusAlert (#后台运行请执行 nohup ./PrometheusAlert &)
Expand Down
2 changes: 1 addition & 1 deletion db/prometheus-alert-template.json

Large diffs are not rendered by default.

0 comments on commit b0cc463

Please sign in to comment.