Open glottisfaun0000 opened 5 months ago
This isn't supported by the Docker container actually.
The simplest thing you could try is building a personal container and use the USER directive.
At the user creation make sure the IDs match.
# syntax=docker/dockerfile:1
FROM python:3.10-slim-buster
RUN \
# Install additional dependencies
apt update && \
apt install -y ffmpeg && \
rm -rf /var/cache/apt/lists ;
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY *.py ./
COPY streamonitor ./streamonitor
EXPOSE 6969
# Change -u parameter to host user id
RUN useradd -r -u 1000 -g appuser appuser
USER appuser
ENTRYPOINT [ "python3", "Downloader.py"]
This should/could work.
To change user/group dynamically more work would be needed. At least a Bash Script as an entrypoint which makes sure to start the app as the wanted user/group.
Running via docker, I have the following environmental variables: environment:
But created video files have the following permissions:
-rw-r--r-- 1 root root
Anything I can change to open up the permissions/get the right user/group? All it really means now is having to do rm -f rather than just rm to get rid of unwanted recordings, but it's a little annoying.