diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6d4e617 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM golang:alpine AS build-env + +RUN apk --no-cache add git make build-base + +RUN git clone --depth 1 https://git.sirrow.work/sirrow/splaschedbot.git +WORKDIR splaschedbot + +RUN mkdir -p /build +RUN go mod tidy +RUN go build -a -tags "netgo" -tags timetzdata -installsuffix netgo -ldflags="-s -w -extldflags \"-static\"" -o=/build/splaschedbot main.go + +FROM alpine:3.22 + +RUN apk --no-cache add ca-certificates +COPY --from=build-env build/splaschedbot /splaschedbot +RUN chmod u+x /splaschedbot + +CMD ["/splaschedbot"] \ No newline at end of file diff --git a/main.go b/main.go index 9c4e530..988f320 100644 --- a/main.go +++ b/main.go @@ -163,6 +163,9 @@ func battleScheduleSub(schedSub []BattleSchedudleSub) string { */ output += fmt.Sprintln() } + if output == "" { + output = "現在、スケジュールはありません。\n" + } return output }