It needs some tweaks to be snappy. The defaults are really bad.
- change database from SQLite to a proper database like MySQL or Postgres, and configure the database server to use your memory fully
- increase the PHP memory limit from the default (128M on many distros) to >1G, the more the better
- install APCu in-memory cache for PHP
- add Redis as additional cache
- turn off the antivirus extension, if installed (ClamAV is useless)
- use http/2 on Apache/nginx to increase performance with multiple connections
Not sure how to do that in docker, I’ve run mine as a plain old PHP-FPM site for years and years. It might be something that can be tweaked using config files or environment variables, or might require building a custom image.
ClamAV is slow and doesn’t catch the nastiest of malware. Its entire approach is stuck in 2008. It’s better than nothing for screening emails, but for a private file store it won’t help much considering that you’ll already have the files on your system somewhere. And most importantly, it slows down file uploads 10x and increases CPU load substantially. The only good reason to use ClamAV for nextcloud is if you will be sued if you don’t!