add dockerfile
This commit is contained in:
parent
5493744f19
commit
af5f5fd6c0
1 changed files with 30 additions and 0 deletions
30
Dockerfile
Normal file
30
Dockerfile
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
FROM golang:1.22-alpine AS dev
|
||||||
|
|
||||||
|
COPY . /var/app
|
||||||
|
WORKDIR /var/app
|
||||||
|
|
||||||
|
ENV GO111MODULE="on" \
|
||||||
|
CGO_ENABLED=0 \
|
||||||
|
GOOS=linux
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
ENTRYPOINT ["sh"]
|
||||||
|
|
||||||
|
|
||||||
|
FROM dev as build
|
||||||
|
|
||||||
|
RUN go mod download && go mod verify
|
||||||
|
RUN go build -o ntppool-exporter main.go
|
||||||
|
RUN chmod +x ntppool-exporter
|
||||||
|
|
||||||
|
|
||||||
|
FROM scratch AS prod
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=build /var/app/ntppool-exporter /bin/
|
||||||
|
|
||||||
|
LABEL maintainer="Adora Laura Kalb <adora@lila.network>"
|
||||||
|
|
||||||
|
EXPOSE 43609
|
||||||
|
ENTRYPOINT ["/bin/ntppool-exporter"]
|
||||||
|
CMD [""]
|
Loading…
Reference in a new issue