diff --git a/Dockerfile b/Dockerfile index 99a6b59..8d5b277 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,17 @@ +FROM golang:alpine AS build +MAINTAINER chris +RUN apk add git --no-cache && \ + go get -u github.com/mdlayher/apcupsd_exporter && \ + go get -t -v ./... + FROM alpine:latest RUN apk update && apk upgrade -RUN apk add --no-cache libusb apcupsd apcupsd-doc apcupsd-webif apache2 +RUN apk add --no-cache libusb apcupsd -COPY apache2.conf /etc/apache2/httpd.conf COPY apc-deamon.conf /etc/apcupsd/apcupsd.conf +COPY --from=build /go/bin/apcupsd_exporter /sbin/apcupsd_exporter -EXPOSE 80 3551/tcp 3551/udp +EXPOSE 9162 3551/tcp 3551/udp -ENTRYPOINT httpd -k start && /sbin/apcupsd -b +ENTRYPOINT /sbin/apcupsd -b && /sbin/apcupsd_exporter -apcupsd.addr localhost:3551