forked from barebitcoin/btc-buf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (19 loc) · 855 Bytes
/
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
FROM golang:alpine AS builder
WORKDIR /work
## We install grpc-health-probe tool for internal healtch checks
RUN GRPC_HEALTH_PROBE_VERSION=v0.4.18 && \
wget -qO/work/grpc-health-probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
chmod +x /work/grpc-health-probe
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -v -o ./btc-buf .
FROM alpine
COPY --from=builder /work/grpc-health-probe /usr/bin/grpc-health-probe
COPY --from=builder /work/btc-buf /usr/bin/btc-buf
# Verify we installed binaries correctly
RUN btc-buf -h
RUN which grpc-health-probe
EXPOSE 5080
HEALTHCHECK --interval=5s --timeout=3s --start-period=10s --retries=3 CMD [ "grpc-health-probe", "-addr=localhost:5080" ]
ENTRYPOINT [ "btc-buf", "--listen=0.0.0.0:5080" ]