update Dockerfile to install additional packages and modify entrypoint.sh to start DBus and gnome-keyring
This commit is contained in:
+2
-1
@@ -27,7 +27,8 @@ FROM python:3.13-slim-trixie
|
|||||||
ARG PUID=1000
|
ARG PUID=1000
|
||||||
ARG PGID=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/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN groupadd -g ${PGID} appgroup \
|
RUN groupadd -g ${PGID} appgroup \
|
||||||
|
|||||||
+10
-4
@@ -1,11 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Berechtigungen für Volumes setzen (als root)
|
|
||||||
chown -R ${PUID:-1000}:${PGID:-1000} /app/data /tmp/sc-config 2>/dev/null || true
|
chown -R ${PUID:-1000}:${PGID:-1000} /app/data /tmp/sc-config 2>/dev/null || true
|
||||||
chmod 700 /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}"
|
mkdir -p "${SC_CONFIG_DIR:-/tmp/sc-config}"
|
||||||
cat > "${SC_CONFIG_DIR:-/tmp/sc-config}/config.toml" <<'EOF'
|
cat > "${SC_CONFIG_DIR:-/tmp/sc-config}/config.toml" <<'EOF'
|
||||||
[auth]
|
[auth]
|
||||||
@@ -13,11 +11,19 @@ session_backend = "file"
|
|||||||
signing_key_backend = "file"
|
signing_key_backend = "file"
|
||||||
EOF
|
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
|
if [ "$1" = "python" ] || [ "$1" = "/app/scalable_sync.py" ]; then
|
||||||
shift
|
shift
|
||||||
exec gosu appuser python /app/scalable_sync.py "$@"
|
exec gosu appuser python /app/scalable_sync.py "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Sonst: Befehl direkt als appuser ausführen (z. B. sc login)
|
|
||||||
exec gosu appuser "$@"
|
exec gosu appuser "$@"
|
||||||
Reference in New Issue
Block a user