mirror of
https://github.com/Luzifer/nginx-sso.git
synced 2024-12-20 12:51:17 +00:00
39 lines
1,008 B
Docker
39 lines
1,008 B
Docker
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 --no-cache \
|
|
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 <knut@ahlers.me>"
|
|
|
|
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"]
|
|
|
|
USER 1000:1000
|
|
|
|
ENTRYPOINT ["/usr/local/bin/docker-start.sh"]
|
|
CMD ["--"]
|
|
|
|
# vim: set ft=Dockerfile:
|