Docker story refactoring

This commit is contained in:
Markos Gogoulos
2025-11-15 15:01:39 +02:00
parent 9b3d9fe1e7
commit 66e67c751e
49 changed files with 2969 additions and 513 deletions

19
scripts/entrypoint.sh Normal file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
set -e
# Fix permissions on mounted volumes if running as root
if [ "$(id -u)" = "0" ]; then
echo "Fixing permissions on data directories..."
chown -R www-data:www-data /home/mediacms.io/mediacms/logs \
/home/mediacms.io/mediacms/media_files \
/home/mediacms.io/mediacms/static_files \
/var/run/mediacms 2>/dev/null || true
# If command starts with python or celery, run as www-data
if [ "${1:0:1}" != '-' ]; then
exec gosu www-data "$@"
fi
fi
# Execute the command
exec "$@"