mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-12-05 12:02:31 -05:00
Docker story refactoring
This commit is contained in:
19
scripts/entrypoint.sh
Normal file
19
scripts/entrypoint.sh
Normal 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 "$@"
|
||||
Reference in New Issue
Block a user