From 03ee0d70e24998b2c36c805579ad923477f49c77 Mon Sep 17 00:00:00 2001 From: sirrow Date: Sat, 12 Jul 2025 09:51:15 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=95=E3=82=A7=E3=82=B9=E6=9C=9F=E9=96=93?= =?UTF-8?q?=E4=B8=AD=E3=81=AB=E8=A1=A8=E7=A4=BA=E3=81=8C=E3=81=8A=E3=81=8B?= =?UTF-8?q?=E3=81=97=E3=81=8F=E3=81=AA=E3=82=8B=E3=81=AE=E5=AF=BE=E7=AD=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 18 ++++++++++++++++++ main.go | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 Dockerfile 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 }