Revert Dockerfile USER appuser (Synology DSM ACL inkompatibel)
Synology DSM verwendet ACLs (+) auf Docker-Volumes die Vorrang vor Linux- Basisrechten haben. chown/gosu funktioniert nicht gegen DSM-ACLs. Container läuft weiterhin als root im geschlossenen Docker-Netz.
This commit is contained in:
parent
71e588a240
commit
942924199e
2 changed files with 7 additions and 8 deletions
10
Dockerfile
10
Dockerfile
|
|
@ -8,9 +8,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||
ffmpeg \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Non-root user für sichereren Betrieb
|
||||
RUN adduser --disabled-password --gecos "" appuser
|
||||
|
||||
# Python-Dependencies zuerst (Docker Layer Cache)
|
||||
COPY backend/requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
|
@ -18,11 +15,8 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|||
# App-Code
|
||||
COPY backend/ .
|
||||
|
||||
# Media-Verzeichnis mit korrekten Rechten für appuser
|
||||
RUN mkdir -p /data/media/dogs /data/media/diary /data/media/poison \
|
||||
&& chown -R appuser:appuser /data /app
|
||||
|
||||
USER appuser
|
||||
# Media-Verzeichnis
|
||||
RUN mkdir -p /data/media/dogs /data/media/diary /data/media/poison
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
|
|
|
|||
5
backend/entrypoint.sh
Normal file
5
backend/entrypoint.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
# Volume-Rechte bei jedem Start korrigieren, dann zu appuser wechseln
|
||||
chown -R appuser:appuser /data 2>/dev/null || true
|
||||
exec gosu appuser "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue