mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-07 05:55:27 +03:00
Merge 4359aca5bf into 814c497bef
This commit is contained in:
commit
41e73b92ab
@ -287,6 +287,9 @@ RUN --mount=type=bind,source=docker/main/install_memryx.sh,target=/deps/install_
|
||||
|
||||
COPY --from=deps-rootfs / /
|
||||
|
||||
RUN mkdir -p /etc/letsencrypt/www /etc/letsencrypt/live/frigate /usr/local/nginx/logs /config /run /tmp/cache /media/frigate \
|
||||
&& chmod -R a+rwX /etc/letsencrypt /usr/local/nginx /config /run /tmp/cache /media/frigate
|
||||
|
||||
RUN ldconfig
|
||||
|
||||
EXPOSE 5000
|
||||
@ -297,6 +300,8 @@ EXPOSE 8555/tcp 8555/udp
|
||||
ENV S6_LOGGING_SCRIPT="T 1 n0 s10000000 T"
|
||||
# Do not fail on long-running download scripts
|
||||
ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0
|
||||
# Set HOME to cache directory so rootless users can cache downloaded models
|
||||
ENV HOME=/tmp/cache
|
||||
|
||||
ENTRYPOINT ["/init"]
|
||||
CMD []
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#!/command/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
exec logutil-service /dev/shm/logs/certsync
|
||||
exec /usr/local/bin/logutil /dev/shm/logs/certsync/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#!/command/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
exec logutil-service /dev/shm/logs/frigate
|
||||
exec /usr/local/bin/logutil /dev/shm/logs/frigate/
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#!/command/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
exec logutil-service /dev/shm/logs/go2rtc
|
||||
exec /usr/local/bin/logutil /dev/shm/logs/go2rtc/
|
||||
|
||||
@ -7,5 +7,7 @@ set -o errexit -o nounset -o pipefail
|
||||
dirs=(/dev/shm/logs/frigate /dev/shm/logs/go2rtc /dev/shm/logs/nginx /dev/shm/logs/certsync)
|
||||
|
||||
mkdir -p "${dirs[@]}"
|
||||
chown nobody:nogroup "${dirs[@]}"
|
||||
if [ "$(id -u)" = "0" ]; then
|
||||
chown nobody:nogroup "${dirs[@]}"
|
||||
fi
|
||||
chmod 02755 "${dirs[@]}"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#!/command/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
exec logutil-service /dev/shm/logs/nginx
|
||||
exec /usr/local/bin/logutil /dev/shm/logs/nginx/
|
||||
|
||||
@ -65,6 +65,11 @@ function set_worker_processes() {
|
||||
|
||||
set_worker_processes
|
||||
|
||||
# NGINX cannot switch users if running rootless; strip the directive
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
sed -i '/^user root;/d' /usr/local/nginx/conf/nginx.conf || true
|
||||
fi
|
||||
|
||||
# ensure the directory for ACME challenges exists
|
||||
mkdir -p /etc/letsencrypt/www
|
||||
|
||||
|
||||
17
docker/main/rootfs/usr/local/bin/logutil
Executable file
17
docker/main/rootfs/usr/local/bin/logutil
Executable file
@ -0,0 +1,17 @@
|
||||
#!/command/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
LOG_DIR=$1
|
||||
|
||||
if [ -z "$LOG_DIR" ]; then
|
||||
echo "Usage: $0 <log-dir>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CMD=(s6-log -b -- ${S6_LOGGING_SCRIPT:-n20 s1000000 T} "$LOG_DIR")
|
||||
|
||||
if [ "$(id -u)" = "0" ]; then
|
||||
exec /command/s6-envuidgid nobody /command/s6-applyuidgid -U -- "${CMD[@]}"
|
||||
else
|
||||
exec "${CMD[@]}"
|
||||
fi
|
||||
Loading…
Reference in New Issue
Block a user