Static files are missing after fresh composer installation

Your software
My Mautic version is: 4.4.7
My PHP version is: PHP 8.0.28
My Database type and version is:

Your problem
My problem is: Static files like images seem to be missing after a fresh installation using composer.

These errors are showing in the log:

On the backend dashboard the browser log tells me:

GET https://nl.mysite.com/media/images/avatar.png?ssl=1 404
GET https://nl.mysite.com/media/images/favicon.ico?v95b88f97 404

On another page, which should render a mautic form:

mautic-form.js:1          Failed to load resource: the server responded with a status of 404 ()

Tryning to load/visit https://nl.mysite.com/media/js/mautic-form.js?v95b88f97 with the browser renders Mautic’s 404 page.

$ ls -lR docroot/media/
docroot/media/:
total 0
drwxrwxr-x. 2 redacted redacted 144 Mar 26 17:34 css
drwxrwxr-x. 2 redacted redacted 112 Mar 26 17:32 dashboards
drwxrwxr-x. 2 redacted redacted  23 Mar 26 17:32 files
drwxrwxr-x. 2 redacted redacted  23 Mar 26 17:32 images
drwxrwxr-x. 2 redacted redacted  66 Mar 26 17:34 js

docroot/media/css:
total 744
-rw-r--r--. 1 redacted redacted 134578 Mar 26 17:34 app.css
-rw-r--r--. 1 redacted redacted 563514 Mar 26 17:34 libraries.css
-rw-rw-r--. 1 redacted redacted  25384 Mar 26 17:32 mediaelementplayer.css
-rw-rw-r--. 1 redacted redacted  21071 Mar 26 17:32 mediaelementplayer.min.css
-rw-rw-r--. 1 redacted redacted   3327 Mar 26 17:32 modal.css
-rw-rw-r--. 1 redacted redacted   2629 Mar 26 17:32 modal.min.css

docroot/media/dashboards:
total 16
-rw-rw-r--. 1 redacted redacted 3500 Mar 26 17:32 alternative-default.json
-rw-rw-r--. 1 redacted redacted 1155 Mar 26 17:32 default.json
-rw-rw-r--. 1 redacted redacted 1932 Mar 26 17:32 email-overview.json
-rw-rw-r--. 1 redacted redacted 2702 Mar 26 17:32 stats-overview.json

docroot/media/files:
total 0

docroot/media/images:
total 0

docroot/media/js:
total 2428
-rw-r--r--. 1 redacted redacted  395351 Mar 26 17:34 app.js
-rw-r--r--. 1 redacted redacted 2043075 Mar 26 17:34 libraries.js
-rw-rw-r--. 1 redacted redacted   41669 Mar 26 17:32 mautic-form-src.js

Clearly some static files are missing. How do I build them?

Steps I have tried to fix the problem:

  • Cleared the cache, didn’t help.
  • Checked the site URL config. it correctly points to https://nl.mysite.com/

Notes

  • Site uses https
  • Mautic resides on the nl.mysite.com subdomain.