aboutsummaryrefslogtreecommitdiff
path: root/docker-entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'docker-entrypoint.sh')
-rw-r--r--docker-entrypoint.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
new file mode 100644
index 0000000..3c6dc08
--- /dev/null
+++ b/docker-entrypoint.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+echo "You are running with user `id -u`:`id -g`"
+
+if [ `id -u` -eq 0 ] && [ `id -g` -eq 0 ]; then
+ echo "Running in New Mode"
+ if [ "${UID}" -eq 0 ]; then
+ echo "Warning, it is not recommended to run as root user, please check if you have set the UID environment variable"
+ fi
+ echo "Setting umask to ${UMASK}"
+ umask ${UMASK}
+ mkdir -p "${DOWNLOAD_DIR}" "${STATE_DIR}"
+ chown -R "${UID}":"${GID}" /app "${DOWNLOAD_DIR}" "${STATE_DIR}"
+ su-exec "${UID}":"${GID}" python3 app/main.py
+else
+ echo "Running in Legacy Mode"
+ python3 app/main.py
+fi
bgstack15