unlimitted logging!!!!

This commit is contained in:
cool.gitter.choco
2025-03-18 10:07:11 -06:00
parent e4d9352f24
commit cb2b327869
7 changed files with 494 additions and 126 deletions

View File

@@ -6,40 +6,10 @@ if [ -n "${UMASK}" ]; then
umask "${UMASK}"
fi
# Function to start the application
start_application() {
# Start Flask app in the background
echo "Starting Flask application..."
python app.py &
# Wait a moment for Flask to initialize
sleep 2
# Start Celery worker
echo "Starting Celery worker..."
celery -A routes.utils.celery_tasks.celery_app worker --loglevel=info --concurrency=${MAX_CONCURRENT_DL:-3} -Q downloads &
# Keep the script running
wait
}
# Check if custom command was provided
if [ $# -gt 0 ]; then
# Custom command provided, use it instead of default app startup
RUN_COMMAND="$@"
else
# No custom command, use our default application startup
RUN_COMMAND="start_application"
fi
# Check if both PUID and PGID are not set
if [ -z "${PUID}" ] && [ -z "${PGID}" ]; then
# Run as root directly
if [ $# -gt 0 ]; then
exec "$@"
else
start_application
fi
exec "$@"
else
# Verify both PUID and PGID are set
if [ -z "${PUID}" ] || [ -z "${PGID}" ]; then
@@ -49,11 +19,7 @@ else
# Check for root user request
if [ "${PUID}" -eq 0 ] && [ "${PGID}" -eq 0 ]; then
if [ $# -gt 0 ]; then
exec "$@"
else
start_application
fi
exec "$@"
else
# Check if the group with the specified GID already exists
if getent group "${PGID}" >/dev/null; then
@@ -79,10 +45,6 @@ else
chown -R "${USER_NAME}:${GROUP_NAME}" /app || true
# Run as specified user
if [ $# -gt 0 ]; then
exec gosu "${USER_NAME}" "$@"
else
exec gosu "${USER_NAME}" bash -c "$(declare -f start_application); start_application"
fi
exec gosu "${USER_NAME}" "$@"
fi
fi
fi