update Dockerfile to install additional packages and modify entrypoint.sh to start DBus and gnome-keyring

This commit is contained in:
Lukas Pierchalla
2026-09-20 11:19:38 +02:00
parent 2e3e5e43cc
commit ae18a54640
2 changed files with 12 additions and 5 deletions
+2 -1
View File
@@ -27,7 +27,8 @@ FROM python:3.13-slim-trixie
ARG PUID=1000
ARG PGID=1000
RUN apt-get update && apt-get install -y --no-install-recommends gosu \
RUN apt-get update && apt-get install -y --no-install-recommends \
gosu dbus-x11 gnome-keyring libpam-gnome-keyring \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd -g ${PGID} appgroup \
+10 -4
View File
@@ -1,11 +1,9 @@
#!/bin/sh
set -e
# Berechtigungen für Volumes setzen (als root)
chown -R ${PUID:-1000}:${PGID:-1000} /app/data /tmp/sc-config 2>/dev/null || true
chmod 700 /tmp/sc-config 2>/dev/null || true
# config.toml immer schreiben — verhindert DBus/Keyring-Fehler
mkdir -p "${SC_CONFIG_DIR:-/tmp/sc-config}"
cat > "${SC_CONFIG_DIR:-/tmp/sc-config}/config.toml" <<'EOF'
[auth]
@@ -13,11 +11,19 @@ session_backend = "file"
signing_key_backend = "file"
EOF
# Wenn der erste Parameter "python" ist oder das Skript selbst → Python starten
# DBus starten
dbus-daemon --session --fork --address="unix:path=/tmp/dbus-session" 2>/dev/null || true
export DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-session
# gnome-keyring als Secret Service starten (als appuser)
gosu appuser sh -c '
echo -n "" | gnome-keyring-daemon --unlock --components=secrets 2>/dev/null
gnome-keyring-daemon --start --components=secrets 2>/dev/null || true
'
if [ "$1" = "python" ] || [ "$1" = "/app/scalable_sync.py" ]; then
shift
exec gosu appuser python /app/scalable_sync.py "$@"
fi
# Sonst: Befehl direkt als appuser ausführen (z. B. sc login)
exec gosu appuser "$@"