[uwsgi]
# Application module
wsgi-file = app.py
callable = app
pythonpath = /app
chdir = /app

# Process management
master = true
processes = 4
threads = 2
max-requests = 1000
harakiri = 30
thunder-lock = true

# UNIX Domain Socket configuration for nginx
socket = /host/shared/uwsgi.sock
chmod-socket = 666
chown-socket = www-data:www-data

# HTTP socket for direct access
http-socket = :5000

vacuum = true

# Logging
logto = /var/log/uwsgi/timetrack.log
log-maxsize = 50000000
disable-logging = false

# Memory and CPU optimization
memory-report = true
cpu-affinity = 1
reload-on-rss = 512
worker-reload-mercy = 60

# Security
no-site = true
strict = true

# Hot reload in development
py-autoreload = 1

# Buffer size
buffer-size = 32768

# Enable stats server (optional)
stats = 127.0.0.1:9191
stats-http = true

# Die on term signal
die-on-term = true

# Lazy apps for better memory usage
lazy-apps = true