Skip to content

Commit

Permalink
update container entrypoint to restart when config file changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bentol committed Jul 28, 2021
1 parent 6cab48e commit 56b9d75
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
FROM golang:1.13
FROM golang:1.13-alpine

COPY . /work

WORKDIR /work

RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o prometheus-nginxlog-exporter

FROM scratch
FROM alpine

RUN apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing watchexec

COPY --from=0 /work/prometheus-nginxlog-exporter /prometheus-nginxlog-exporter
ADD entrypoint.sh /entrypoint.sh

EXPOSE 4040
ENTRYPOINT ["/prometheus-nginxlog-exporter"]

ENTRYPOINT ["/entrypoint.sh"]
3 changes: 3 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

watchexec -v -w "/etc/prometheus-nginxlog-exporter/" -n -r /prometheus-nginxlog-exporter

0 comments on commit 56b9d75

Please sign in to comment.