konfachcloud-discord-bot/Dockerfile
royalcat 34d1243e06
All checks were successful
docker / build-docker (linux/amd64) (push) Successful in 1m2s
docker / build-docker (linux/arm64) (push) Successful in 2m50s
add volume
2024-06-27 17:01:09 +03:00

20 lines
552 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
VOLUME /data
ENTRYPOINT ["/konfachcloud-discord-bot"]