aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2025-03-07 19:13:17 -0500
committerPaul Duncan <pabs@pablotron.org>2025-03-07 19:13:17 -0500
commit75539a6e72a58a3ec2600a1aa902790660e09791 (patch)
treee15f4db3f8ce3ba5c356793887328273de829b9b /Dockerfile
downloadjim-bot-75539a6e72a58a3ec2600a1aa902790660e09791.tar.xz
jim-bot-75539a6e72a58a3ec2600a1aa902790660e09791.zip
initial commitr20250307
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile16
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"]