Spaces:
Paused
Paused
Create entrypoint.sh
Browse files- entrypoint.sh +24 -0
entrypoint.sh
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env sh
|
| 2 |
+
|
| 3 |
+
# set -e Exit the script if an error happens
|
| 4 |
+
set -e
|
| 5 |
+
PUID=${PUID=0}
|
| 6 |
+
PGID=${PGID=0}
|
| 7 |
+
|
| 8 |
+
echo "--->$(whoami)"
|
| 9 |
+
|
| 10 |
+
files_ownership () {
|
| 11 |
+
# -h Changes the ownership of an encountered symbolic link and not that of the file or directory pointed to by the symbolic link.
|
| 12 |
+
# -R Recursively descends the specified directories
|
| 13 |
+
# -c Like verbose but report only when a change is made
|
| 14 |
+
chown -hRc "$PUID":"$PGID" /app/data
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
echo "==> Performing startup jobs and maintenance tasks"
|
| 18 |
+
files_ownership
|
| 19 |
+
|
| 20 |
+
echo "==> Starting application with user $PUID group $PGID"
|
| 21 |
+
|
| 22 |
+
# --clear-groups Clear supplementary groups.
|
| 23 |
+
exec setpriv --reuid "$PUID" --regid "$PGID" --clear-groups "$@"
|
| 24 |
+
# echo $PUID
|