2020-09-15 09:06:32 +00:00
|
|
|
FROM golang:1.14-alpine AS builder
|
2020-09-15 08:29:41 +00:00
|
|
|
|
|
|
|
WORKDIR ${GOPATH}/src/git.bjphoster.com/bryanpedini/go-totp
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN go get -d -v
|
2020-09-15 09:14:15 +00:00
|
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix gco -ldflags="-w -s" -o /go/bin/go-totp
|
2020-09-15 08:29:41 +00:00
|
|
|
|
2020-09-15 09:14:15 +00:00
|
|
|
FROM scratch
|
2020-09-15 08:29:41 +00:00
|
|
|
LABEL maintainer="Bryan Joshua Pedini <b.pedini@bjphoster.com>"
|
|
|
|
|
|
|
|
COPY --from=builder /go/bin/go-totp /app/go-totp
|
2020-09-15 09:14:15 +00:00
|
|
|
COPY ./templates /app/templates
|
|
|
|
COPY ./static /app/static
|
2020-09-15 08:29:41 +00:00
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
2020-09-15 09:14:15 +00:00
|
|
|
WORKDIR /app
|
2020-09-15 08:29:41 +00:00
|
|
|
ENTRYPOINT ["/app/go-totp"]
|