Dispatcharr/docker/uwsgi.dev.ini
Patti 63fed9131a Add user stream profile settings and configurable service ports
- Add stream profile selection to user settings, allowing per-user default streaming profiles
- Add configurable environment variables for UWSGI_PORT, REDIS_PORT, and DAPHNE_PORT
- Add PostgreSQL database existence check in initialization scripts
- Update nginx, uwsgi configs, and entrypoint to use configurable ports
2026-01-20 21:43:17 +01:00

62 lines
No EOL
2.1 KiB
INI

[uwsgi]
; Remove file creation commands since we're not logging to files anymore
; exec-pre = mkdir -p /data/logs
; exec-pre = touch /data/logs/uwsgi-dev.log
; exec-pre = chmod 666 /data/logs/uwsgi-dev.log
; First run Redis availability check script once
exec-pre = python /app/scripts/wait_for_redis.py
; Start Redis first
attach-daemon = redis-server --port $(REDIS_PORT)
; Then start other services with configurable nice level (default: 5 for low priority)
; Users can override via CELERY_NICE_LEVEL environment variable in docker-compose
attach-daemon = nice -n $(CELERY_NICE_LEVEL) celery -A dispatcharr worker --autoscale=6,1
attach-daemon = nice -n $(CELERY_NICE_LEVEL) celery -A dispatcharr beat
attach-daemon = daphne -b 0.0.0.0 -p $(DAPHNE_PORT) dispatcharr.asgi:application
attach-daemon = cd /app/frontend && npm run dev
# Core settings
chdir = /app
module = dispatcharr.wsgi:application
virtualenv = /dispatcharrpy
master = true
env = DJANGO_SETTINGS_MODULE=dispatcharr.settings
socket = /app/uwsgi.sock
chmod-socket = 777
vacuum = true
die-on-term = true
static-map = /static=/app/static
# Worker management (Optimize for I/O bound tasks)
workers = 4
threads = 2
enable-threads = true
# Optimize for streaming
http = 0.0.0.0:$(UWSGI_PORT)
http-keepalive = 1
buffer-size = 65536 # Increase buffer for large payloads
post-buffering = 4096 # Reduce buffering for real-time streaming
http-timeout = 600 # Prevent disconnects from long streams
lazy-apps = true # Improve memory efficiency
# Async mode (use gevent for high concurrency)
gevent = 100
async = 100
# Performance tuning
thunder-lock = true
log-4xx = true
log-5xx = true
disable-logging = false
# Logging configuration - development mode
# Enable console logging (stdout)
log-master = true
# Enable strftime formatting for timestamps
logformat-strftime = true
log-date = %%Y-%%m-%%d %%H:%%M:%%S,000
# Use formatted time with environment variable for log level
log-format = %(ftime) $(DISPATCHARR_LOG_LEVEL) uwsgi.requests Worker ID: %(wid) %(method) %(status) %(uri) %(msecs)ms
log-buffering = 1024 # Add buffer size limit for logging