1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-12-20 12:51:17 +00:00

Move Docker image to use non-root user

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2023-07-29 13:44:05 +02:00
parent 6eb40a044a
commit ad7c1dd693
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5

View file

@ -6,12 +6,13 @@ WORKDIR /go/src/github.com/Luzifer/nginx-sso
ENV CGO_ENABLED=0
RUN set -ex \
&& apk add --update \
&& 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>"
@ -30,6 +31,8 @@ COPY --from=builder /go/src/github.com/Luzifer/nginx-sso/frontend/* /usr/l
EXPOSE 8082
VOLUME ["/data"]
USER 1000:1000
ENTRYPOINT ["/usr/local/bin/docker-start.sh"]
CMD ["--"]