konfachcloud-discord-bot/Dockerfile
royalcat 70b506036a
All checks were successful
docker / build-docker (linux/amd64) (push) Successful in 1m9s
docker / build-docker (linux/arm64) (push) Successful in 2m55s
init
2024-06-27 16:45:32 +03:00

19 lines
539 B
Docker

FROM golang:1.22 as builder
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
RUN --mount=type=cache,mode=0777,target=/go/pkg/mod go mod download all
COPY ./cmd ./cmd
COPY ./src ./src
RUN --mount=type=cache,mode=0777,target=/go/pkg/mod CGO_ENABLED=0 go build -tags timetzdata -o /konfachcloud-discord-bot ./cmd/bot/main.go
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /konfachcloud-discord-bot /konfachcloud-discord-bot
ENTRYPOINT ["/konfachcloud-discord-bot"]