Serving the files via gunicorn is much slower than directly from the web server/ngnix
We optimised this in insights-ng. See example in insights-ng:
insights salt file:
dokku storage:ensure-directory insights_static
dokku storage:mount insights-ng /var/lib/dokku/data/storage/insights_static:/insights_static
insights_ngnix_static_conf:
file.managed:
- name: /home/dokku/insights/nginx.conf.d/static.conf
- source: salt://nginx/insights_static.conf
- require:
- cmd: insights_create_app
static.conf:
location /static/ {
alias /var/lib/dokku/data/storage/insights_static/;
}