From 75539a6e72a58a3ec2600a1aa902790660e09791 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Fri, 7 Mar 2025 19:13:17 -0500 Subject: initial commit --- Dockerfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Dockerfile (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a9abbab --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +# build stage +FROM docker.io/golang:1.24.1-alpine AS build +COPY . /src +WORKDIR /src + +# cache /go between builds to cache packages and improve build speed +RUN --mount=type=cache,target=/go ["go", "build", "-trimpath", "-ldflags=-s -w"] + +# run stage +# +# this stage used to use "FROM scratch", but we need ca-certificates in +# order to connect to the NWS API. +FROM gcr.io/distroless/static +ENV TZ "America/New_York" +COPY --from=build /src/jim-bot /jim-bot +CMD ["/jim-bot"] -- cgit v1.2.3