-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
30 lines (25 loc) · 914 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:1.19 as builder
ARG IMAGE_TAG
RUN mkdir -p /go/src/github.com/ScoreTrak/ScoreTrak
WORKDIR /go/src/github.com/ScoreTrak/ScoreTrak
COPY pkg/ pkg/
COPY cmd/ cmd/
COPY main.go main.go
COPY go.mod go.mod
COPY go.sum go.sum
RUN go mod download
RUN go build -o scoretrak -ldflags "-X 'github.com/ScoreTrak/ScoreTrak/pkg/version.Version=${IMAGE_TAG}'"
RUN chmod +x scoretrak
FROM debian:bullseye-slim
COPY --from=builder \
/go/src/github.com/ScoreTrak/ScoreTrak/scoretrak \
/go/bin/scoretrak
RUN apt-get update \
&& apt-get install -y wget \
&& rm -rf /var/lib/apt/lists/*
# Setup grpc-health-probe
RUN GRPC_HEALTH_PROBE_VERSION=v0.4.8 && \
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
chmod +x /bin/grpc_health_probe
ENTRYPOINT ["/go/bin/scoretrak"]
CMD ["master"]