1

Does anyone have any experience with Drupal 9 either without composer or in an airgap? Basically we're trying to run it in an airgapped server. Composer obviously wants to access the internet for checking and downloading packages.

  • Why does Composer do that? Usually, you deploy your application and never run Composer on the production server again – Nico Haase Mar 12 '21 at 05:32

1 Answers1

-1

You'll need to run composer to install your packages and create your autoload files to make it all work.

You could create your own local package repository and store the packages you need there, however this would be a large undertaking given all the dependencies Drupal Core and contrib modules use. You'd need to manage them all yourself, and keep your local versions synced with the public versions, especially for security updates.

If you need to do that anyway, you're better off just using the public repos.

Documentation on composer repos is here: https://getcomposer.org/doc/05-repositories.md

Near the bottom it shows how to disable the default packagist repo: https://getcomposer.org/doc/05-repositories.md#disabling-packagist-org


A much simpler alternative would be to do development in a non air gapped environment so you have access to the packages you need and can run composer commands to install everything. Then once your code is in the state you need, copy that to your air gapped server to run. Once composer install has run it is not required to do anything else. Just make sure you include the vendor directory with all your dependencies, as well as drupal core and contribs.

The server you run your Drupal instance on, does not even require composer to be installed.

  • A lot of build tools/processes are also in air-gapped environments explicitly to prevent tools from downloading random stuff during the build process and so that each package and library is known going into the build. There are certain sectors where this is very important – Hiker86 Jan 27 '22 at 17:19