2021-03-18 20:57:29 +01:00
|
|
|
FROM golang:alpine as build
|
|
|
|
|
|
|
|
WORKDIR /root
|
|
|
|
COPY . /root
|
2022-08-29 20:51:43 +02:00
|
|
|
RUN go install golang.org/x/tools/cmd/stringer@latest && go generate ./... && go build .
|
2021-03-18 20:57:29 +01:00
|
|
|
|
|
|
|
FROM alpine:latest
|
|
|
|
|
2022-08-29 22:13:37 +02:00
|
|
|
ENV LISTEN_ADDRESS="0.0.0.0" LISTEN_PORT="9452"
|
2021-03-18 20:57:29 +01:00
|
|
|
|
|
|
|
RUN addgroup -S mystrom \
|
|
|
|
&& adduser -S mystrom -G mystrom \
|
|
|
|
&& mkdir /app \
|
|
|
|
&& chown -R mystrom:mystrom /app
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
USER mystrom
|
|
|
|
COPY --from=build /root/mystrom-exporter /app
|
|
|
|
|
2022-08-29 22:13:37 +02:00
|
|
|
CMD /app/mystrom-exporter -web.listen-address $LISTEN_ADDRESS:$LISTEN_PORT
|