-
Notifications
You must be signed in to change notification settings - Fork 690
/
Dockerfile
48 lines (29 loc) · 1.13 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM golang:1.20.6-alpine3.18 as builder
WORKDIR $GOPATH/src/github.com/feiyu563/PrometheusAlert
RUN apk update && \
apk add --no-cache gcc g++ sqlite-libs make git
ENV GO111MODULE on
ENV GOPROXY https://goproxy.io
COPY . $GOPATH/src/github.com/feiyu563/PrometheusAlert
RUN make build
# -----------------------------------------------------------------------------
FROM alpine:3.18
LABEL maintainer="jikun.zhang"
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 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
WORKDIR /app
COPY --from=builder /go/src/github.com/feiyu563/PrometheusAlert/PrometheusAlert .
COPY db/PrometheusAlertDB.db /opt/PrometheusAlertDB.db
COPY conf/app-example.conf conf/app.conf
COPY db db
COPY static static
COPY views views
COPY docker-entrypoint.sh docker-entrypoint.sh
ENTRYPOINT [ "/bin/sh", "/app/docker-entrypoint.sh" ]