Merge pull request #2917 from bill88t/master

Added the USER_UID & USER_GID env variables
This commit is contained in:
zadam 2022-06-13 23:17:59 +02:00 committed by GitHub
commit 63cabb13b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -22,7 +22,7 @@ RUN set -x \
&& apk del .build-dependencies
# Some setup tools need to be kept
RUN apk add --no-cache su-exec
RUN apk add --no-cache su-exec shadow
# Bundle app source
COPY . .

View file

@ -1,5 +1,7 @@
#!/bin/sh
[[ ! -z "${USER_UID}" ]] && usermod -u ${USER_UID} node || echo "No USER_UID specified, leaving 1000"
[[ ! -z "${USER_GID}" ]] && groupmod -g ${USER_GID} node || echo "No USER_GID specified, leaving 1000"
chown -R node:node /home/node
[ -d "$TRILIUM_DATA_DIR" ] && chown -R node:node "$TRILIUM_DATA_DIR"
su-exec node node ./src/www