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

[#79] Fix Docker image broken by user change

- Properly check file existence (`-f`, not `-d`)
- Create and chown the data directory in case no mount is present

closes #79

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2023-07-29 16:59:05 +02:00
parent 1cd016d4e0
commit 4fca15fa21
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5
2 changed files with 4 additions and 2 deletions

View file

@ -21,7 +21,9 @@ RUN set -ex \
&& apk --no-cache add \ && apk --no-cache add \
bash \ bash \
ca-certificates \ ca-certificates \
dumb-init dumb-init \
&& mkdir /data \
&& chown -R 1000:1000 /data
COPY --from=builder /go/bin/nginx-sso /usr/local/bin/ 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/config.yaml /usr/local/share/nginx-sso/

View file

@ -2,7 +2,7 @@
set -euo pipefail set -euo pipefail
# Copy frontend if not available # Copy frontend if not available
[ -d /data/frontend/index.html ] || cp -r /usr/local/share/nginx-sso/frontend /data/ [ -f /data/frontend/index.html ] || cp -r /usr/local/share/nginx-sso/frontend /data/
[ -e /data/config.yaml ] || { [ -e /data/config.yaml ] || {
cp /usr/local/share/nginx-sso/config.yaml /data/config.yaml cp /usr/local/share/nginx-sso/config.yaml /data/config.yaml