Browse Source

Fix Docker image to just work without any arguments and drop chown of default data volume

pull/520/head
James Mills 3 weeks ago
parent
commit
44534163d8
Signed by: prologic GPG Key ID: AC4C014F1440EBD6
  1. 15
      .dockerfiles/entrypoint.sh

15
.dockerfiles/entrypoint.sh

@ -1,10 +1,21 @@
#!/bin/sh
random_string() {
tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 64 | head -n 1
}
[ -n "${PUID}" ] && usermod -u "${PUID}" yarnd
[ -n "${PGID}" ] && groupmod -g "${PGID}" yarnd
printf "Fixing ownership of default /data volume...\n"
chown -R yarnd:yarnd /data
printf "Configuring yarnd..."
[ -z "${DATA}" ] && DATA="/data"
[ -z "${STORE}" ] && STORE="bitcask:///data/yarn.db"
[ -z "${OPEN_REGISTRATIONS}" ] && OPEN_REGISTRATIONS=true
[ -z "${OPEN_PROFILES}" ] && OPEN_PROFILES=true
[ -z "${COOKIE_SECRET}" ] && COOKIE_SECRET="$(random_string)"
[ -z "${MAGICLINK_SECRET}" ] && MAGICLINK_SECRET="$(random_string)"
[ -z "${API_SIGNING_KEY}" ] && API_SIGNING_KEY="$(random_string)"
export DATA STORE OPEN_REGISTRATIONS OPEN_PROFILES COOKIE_SECRET MAGICLINK_SECRET API_SIGNING_KEY
printf "Switching UID=%s and GID=%s\n" "${PUID}" "${PGID}"
exec su-exec yarnd:yarnd "$@"

Loading…
Cancel
Save