-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
executable file
·30 lines (25 loc) · 1.19 KB
/
docker-entrypoint.sh
File metadata and controls
executable file
·30 lines (25 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# App-Dateien bei jedem Start aus dem Image ins Volume aktualisieren
cp /opt/webdash/app.php /var/www/html/.dashboard/app.php
# Standard-Assets nur kopieren wenn sie fehlen
for f in app-logo-dark.png app-logo-light.png favicon-dark.png favicon-light.png; do
[ -f "/var/www/html/.dashboard/$f" ] || cp "/opt/webdash/$f" "/var/www/html/.dashboard/$f"
done
# Wallpapers kopieren wenn Verzeichnis fehlt
if [ ! -d "/var/www/html/.dashboard/wallpapers" ] && [ -d "/opt/webdash/wallpapers" ]; then
cp -r /opt/webdash/wallpapers /var/www/html/.dashboard/wallpapers
fi
# Docker-Socket-Berechtigung: www-data braucht Zugriff auf den Docker Socket
if [ -S /var/run/docker.sock ]; then
DOCKER_GID=$(stat -c '%g' /var/run/docker.sock 2>/dev/null)
if [ -n "$DOCKER_GID" ] && [ "$DOCKER_GID" != "0" ]; then
groupadd -g "$DOCKER_GID" dockerhost 2>/dev/null || true
usermod -aG dockerhost www-data
else
# Socket gehört root → www-data zu root-Gruppe oder chmod
chmod 660 /var/run/docker.sock 2>/dev/null || true
chgrp www-data /var/run/docker.sock 2>/dev/null || true
fi
fi
chown -R www-data:www-data /var/www/html/.dashboard
exec apache2-foreground