FROM golang:alpine as builder ADD . /go/src/github.com/Luzifer/nginx-sso WORKDIR /go/src/github.com/Luzifer/nginx-sso ENV CGO_ENABLED=0 RUN set -ex \ && apk add --update \ git \ && go install \ -ldflags "-X main.version=$(git describe --tags || git rev-parse --short HEAD || echo dev)" \ -mod=readonly FROM alpine LABEL maintainer "Knut Ahlers " RUN set -ex \ && apk --no-cache add \ bash \ ca-certificates \ dumb-init COPY --from=builder /go/bin/nginx-sso /usr/local/bin/ COPY --from=builder /go/src/github.com/Luzifer/nginx-sso/config.yaml /usr/local/share/nginx-sso/ COPY --from=builder /go/src/github.com/Luzifer/nginx-sso/docker-start.sh /usr/local/bin/ COPY --from=builder /go/src/github.com/Luzifer/nginx-sso/frontend/* /usr/local/share/nginx-sso/frontend/ EXPOSE 8082 VOLUME ["/data"] ENTRYPOINT ["/usr/local/bin/docker-start.sh"] CMD ["--"] # vim: set ft=Dockerfile: