Directory structure with a composer-built Drupal site

Typically a Composer-built Drupal 9 site will have a directory structure like this:

Project-name
/vendor
/web
/composer.json
/composer.lock

The codesbase for the site is in /web and the Composer-related directories and files are outside but at the same level as the web root.

DreamHost replaces this path: /var/www/sites/html elsewhere

with this path: /home/myusername/example.com

If I build a Drupal site locally with DDEV and want to upload it to DH for production, do I:

  • Simply upload the contents of /web to /home/myusername/example.com and ignore the Composer-specific pieces?
  • Put /vendor, /composer.json, /composer.lock into /home/myusername at the same level as example.com?
  • Put the entire project into example.com and somehow (???) make the server point to /home/myusername/projectname/web

Thanks.

I think this last one would be the natural thing to do:

On the DH Panel, you can set the web-directory to any path in the Manage-Domains section:

https://panel.dreamhost.com/?tree=domain.manage

1 Like

Thank you very much.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.