Skip to content

Commit

Permalink
chore: add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
luissimas committed Jun 19, 2024
1 parent acc2c9f commit 8180e6e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bin
docs
examples
.gitignore
.git/
**/*.md
Dockerfile
Makefile
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM golang:1.22 AS build-stage

WORKDIR /app

COPY go.mod go.sum ./
RUN go mod download

COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -o /zettelkasten-exporter ./cmd/zettelkasten-exporter/main.go

FROM gcr.io/distroless/base-debian12 AS release-stage

WORKDIR /

COPY --from=build-stage /zettelkasten-exporter /zettelkasten-exporter

USER nonroot:nonroot

ENTRYPOINT ["/zettelkasten-exporter"]
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ run: build
INFLUXDB_ORG=default \
INFLUXDB_BUCKET=zettelkasten \
./bin/$(BINARY_NAME)

docker:
docker build . -t zettelkasten-exporter:latest

0 comments on commit 8180e6e

Please sign in to comment.