#!/bin/bash set -e # scripts/start_flower.sh # Set default values REDIS_HOST=${REDIS_URL:-redis} REDIS_PORT=${REDIS_PORT:-6379} # Set environment-specific variables if [ "$FLASK_ENV" = "production" ]; then # Production settings export FLOWER_BASIC_AUTH="${FLOWER_USER}:${FLOWER_PASSWORD}" export FLOWER_BROKER_URL="redis://${REDIS_USER}:${REDIS_PASS}@${REDIS_URL}:${REDIS_PORT}/0" export CELERY_BROKER_URL="redis://${REDIS_USER}:${REDIS_PASS}@${REDIS_URL}:${REDIS_PORT}/0" else # Development settings export FLOWER_BROKER_URL="redis://${REDIS_HOST}:${REDIS_PORT}/0" export CELERY_BROKER_URL="redis://${REDIS_HOST}:${REDIS_PORT}/0" fi echo $BROKER_URL echo "----------" # Start Flower exec celery flower \ --url-prefix=/flower \ --port=5555