configui/Dockerfile

22 lines
675 B
Docker
Raw Normal View History

2021-10-18 08:49:16 +00:00
FROM golang:1.17.2-alpine3.14 as builder
RUN apk update && apk add --no-cache git tzdata
WORKDIR /src
2021-10-20 16:12:12 +00:00
# not using any libs, for now
# COPY go.mod go.sum /src/
# RUN go mod download
2021-10-18 08:49:16 +00:00
COPY . .
2021-10-20 16:12:12 +00:00
RUN VERSION=$(git describe --tags --abbrev=0) BUILD=$(git rev-parse --short HEAD) && \
2021-10-18 08:49:16 +00:00
GOOS=linux GOARCH=amd64 \
go build -ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD} -w" \
-o /go/bin/configui main.go
FROM alpine:3.14
EXPOSE 5080
ENV PATH="/go/bin:${PATH}"
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /go/bin/configui /go/bin/configui
2021-10-20 16:12:12 +00:00
CMD ["/go/bin/configui","-log","/var/log/configui.log","-f","/data/configui.json"]