watchdog-goにDockerfileを追加

This commit is contained in:
usbharu 2024-03-10 21:42:52 +09:00
parent 7a0295bfe8
commit 87018c89cc
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
1 changed files with 11 additions and 0 deletions

11
watchdog-go/Dockerfile Normal file
View File

@ -0,0 +1,11 @@
FROM golang:1.22.1-alpine3.19 as build
WORKDIR /app
COPY go.mod go.sum main.go ./
COPY git.usbharu.dev/ ./git.usbharu.dev
RUN go mod download && go build -o watchdog-go -ldflags="-s -w" -trimpath
FROM alpine:3.19
WORKDIR /app
COPY --from=build /app/watchdog-go .
USER 1001
CMD ["/app/watchdog-go"]