-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
27 lines (19 loc) · 869 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
# syntax = docker/dockerfile:1.3-labs
ARG APP_NAME="tvbit-bot"
FROM golang:1 as builder
WORKDIR /go/src/${APP_NAME}
RUN go env -w GOMODCACHE=/root/.cache/go-build
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/root/.cache/go-build go mod download
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 GOOS=linux go build -o /app cmd/main.go
FROM gcr.io/distroless/static-debian12 as production
LABEL maintainer="rluisr" \
org.opencontainers.image.url="https://github.com/rluisr/tvbit-bot" \
org.opencontainers.image.source="https://github.com/rluisr/tvbit-bot" \
org.opencontainers.image.vendor="rluisr" \
org.opencontainers.image.title="tvbit-bot" \
org.opencontainers.image.description="TradingView webhook handler for Bybit." \
org.opencontainers.image.licenses="AGPL"
COPY --from=builder /app /app
ENTRYPOINT ["/app"]