This commit is contained in:
2025-09-05 11:13:26 -04:00
parent 32a2c2c1c4
commit e01c5b0896
3 changed files with 9 additions and 3 deletions
+4 -3
View File
@@ -8,10 +8,11 @@ services:
volumes:
- .:/app
environment:
- FLASK_ENV=production
- FLASK_ENV=development
- DISABLE_ANALYTICS=true
restart: unless-stopped
# Use Gunicorn with gevent workers for better async performance
command: ["gunicorn", "--bind", "0.0.0.0:8000", "--worker-class", "gevent", "--workers", "4", "--worker-connections", "1000", "--timeout", "60", "engine:app"]
# Use single worker for local development
command: ["gunicorn", "--bind", "0.0.0.0:8000", "--worker-class", "gevent", "--workers", "1", "--worker-connections", "1000", "--timeout", "60", "--reload", "engine:app"]
# Alternative dev configuration - uncomment to use Flask dev server
# web-dev:
+3
View File
@@ -12,6 +12,9 @@ import html
app = Flask(__name__, template_folder='templates')
# Configuration
app.config['DISABLE_ANALYTICS'] = os.environ.get('DISABLE_ANALYTICS', 'false').lower() == 'true'
# Add custom Jinja2 filters
@app.template_filter('strftime')
def strftime_filter(date, fmt='%Y-%m-%d'):
+2
View File
@@ -805,6 +805,7 @@
{% block extra_head %}{% endblock %}
<!-- Analytics -->
{% if not (config.get('DISABLE_ANALYTICS') or request.environ.get('DISABLE_ANALYTICS')) %}
<script type="text/javascript">
var _gauges = _gauges || [];
(function() {
@@ -819,6 +820,7 @@
s.parentNode.insertBefore(t, s);
})();
</script>
{% endif %}
</head>
<body>
<article>