diff options
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 16 |
1 files changed, 16 insertions, 0 deletions
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"] |