add Dockerfile and publish-image workflow for Docker image automation
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
FROM golang:1.23-alpine AS builder
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o /out/discord-thread-bot .
|
||||
|
||||
FROM gcr.io/distroless/static-debian12:nonroot
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=builder /out/discord-thread-bot /app/discord-thread-bot
|
||||
|
||||
ENTRYPOINT ["/app/discord-thread-bot"]
|
||||
Reference in New Issue
Block a user