Docker entrypoint for running the application as non-root user

This commit is contained in:
Michal Ciania
2021-09-17 22:57:27 +02:00
parent 5be51abd8f
commit 9eaa4ab846
3 changed files with 40 additions and 21 deletions

13
extra/entrypoint.sh Normal file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env sh
set -e
files_ownership () {
chown -hRc "${PUID=1000}":"${PGID=1000}" /app/data
}
echo "==> Performing startup jobs and maintenance tasks"
files_ownership
echo "==> Starting application with user ${PUID=1000} group ${PGID=1000}"
exec setpriv --reuid "${PUID=1000}" --regid "${PGID=1000}" --clear-groups "$@"