Updated and fixes. v1.0.4
This commit is contained in:
29
docker-entrypoint.sh
Executable file
29
docker-entrypoint.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Get environment variables with defaults
|
||||
FLASK_DEBUG="${FLASK_DEBUG:-False}"
|
||||
FLASK_ENV="${FLASK_ENV:-production}"
|
||||
FLASK_PORT="${FLASK_PORT:-5172}"
|
||||
FLASK_HOST="${FLASK_HOST:-0.0.0.0}"
|
||||
|
||||
echo "Starting Mailcow Alias Manager..."
|
||||
echo "Environment: $FLASK_ENV"
|
||||
echo "Debug mode: $FLASK_DEBUG"
|
||||
echo "Port: $FLASK_PORT"
|
||||
|
||||
# Check if we should run in production mode
|
||||
if [ "$FLASK_ENV" = "production" ] && [ "$FLASK_DEBUG" != "True" ] && [ "$FLASK_DEBUG" != "true" ] && [ "$FLASK_DEBUG" != "1" ]; then
|
||||
echo "Starting with Gunicorn (production mode)..."
|
||||
exec gunicorn --bind $FLASK_HOST:$FLASK_PORT \
|
||||
--workers 4 \
|
||||
--threads 2 \
|
||||
--timeout 120 \
|
||||
--access-logfile - \
|
||||
--error-logfile - \
|
||||
--log-level info \
|
||||
"app:app"
|
||||
else
|
||||
echo "Starting with Flask development server (debug mode)..."
|
||||
exec python app.py
|
||||
fi
|
||||
Reference in New Issue
Block a user