1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-12-30 01:31:18 +00:00
nginx-sso/Dockerfile

40 lines
1.2 KiB
Text
Raw Normal View History

FROM golang:alpine as builder
ADD . /go/src/github.com/Luzifer/nginx-sso
WORKDIR /go/src/github.com/Luzifer/nginx-sso
ENV CGO_ENABLED=1
RUN set -ex \
&& apk add --update \
build-base \
git \
&& go install -ldflags "-X main.version=$(git describe --tags || git rev-parse --short HEAD || echo dev)"
FROM alpine:3.8
LABEL maintainer "Knut Ahlers <knut@ahlers.me>"
RUN set -ex \
&& apk --no-cache add \
bash \
ca-certificates \
curl \
&& curl -sSfLo /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 \
&& chmod +x /usr/local/bin/dumb-init \
&& apk --no-cache del --purge \
curl
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: