Skip to content

Commit e6ed7d9

Browse files
authored
feat: add a default Dockerfile (#48)
1 parent 321836a commit e6ed7d9

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM golang:1.23-alpine3.21 AS build
2+
3+
ARG TARGETARCH=amd64
4+
ENV GOARCH=${TARGETARCH}
5+
6+
WORKDIR /opt
7+
8+
COPY . .
9+
10+
RUN go build .
11+
12+
FROM alpine:3.21
13+
14+
RUN apk update && apk upgrade && apk add --no-cache curl
15+
16+
WORKDIR /opt
17+
18+
COPY --from=build /opt/kvrocks_exporter kvrocks_exporter
19+
20+
COPY --from=build /opt/LICENSE .
21+
22+
EXPOSE 9121/tcp
23+
24+
HEALTHCHECK --interval=30s --timeout=1s --start-period=5s --retries=3 CMD curl --fail -s http://localhost:9121/health | grep 'ok' || exit 1
25+
26+
ENTRYPOINT [ "/kvrocks_exporter" ]

0 commit comments

Comments
 (0)