-
-
Notifications
You must be signed in to change notification settings - Fork 41
/
Dockerfile
41 lines (29 loc) · 1.03 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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 <[email protected]>"
RUN set -ex \
&& apk --no-cache add \
bash \
ca-certificates \
dumb-init \
&& mkdir /data \
&& chown -R 1000:1000 /data
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: