From 85ce5685ba7ae589a1ca06f6d62f33aaf76af443 Mon Sep 17 00:00:00 2001 From: minie4 Date: Fri, 3 May 2024 16:58:24 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B3=20Add=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 17 +++++++++++++++++ Dockerfile | 11 +++++++++++ 2 files changed, 28 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a36b7f8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,17 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Go workspace file +go.work + +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cd1ec72 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM golang:1.22-alpine + +WORKDIR /app +COPY go.mod go.sum ./ +RUN go mod download + +COPY ./ ./ +RUN CGO_ENABLED=0 GOOS=linux go build -o /tplinkswitchexporter + +EXPOSE 9717 +CMD ["/tplinkswitchexporter"] \ No newline at end of file