Run frigate & nginx inside of container as user 'frigate' and allow a way to set the uid and gid of this user to better facilitate network storage mounts.

This commit is contained in:
Ilya Rakhlin
2021-08-14 16:46:48 -04:00
committed by Ilya Rakhlin
parent 1f1a708388
commit 6b462e482c
11 changed files with 55 additions and 30 deletions
+16
View File
@@ -0,0 +1,16 @@
#! /bin/bash
if [[ "$(ls /var/run/s6/container_environment/ | xargs)" == *"FILE__"* ]]; then
for FILENAME in /var/run/s6/container_environment/*; do
if [[ "${FILENAME##*/}" == "FILE__"* ]]; then
SECRETFILE=$(cat ${FILENAME})
if [[ -f ${SECRETFILE} ]]; then
FILESTRIP=${FILENAME//FILE__/}
cat ${SECRETFILE} > ${FILESTRIP}
echo "[env-init] ${FILESTRIP##*/} set from ${FILENAME##*/}"
else
echo "[env-init] cannot find secret in ${FILENAME##*/}"
fi
fi
done
fi
+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/with-contenv bash
PUID=${PUID:-1000}
PGID=${PGID:-1000}
groupmod -o -g "$PGID" frigate
usermod -o -u "$PUID" frigate
chown -R frigate:frigate /opt/frigate/frigate
chown -R frigate:frigate /opt/frigate/migrations
chown -R frigate:frigate /opt/frigate/web
chown -R frigate:frigate /usr/local/nginx