Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buildpack support for Drupal 8 #253

Open
badri opened this issue Aug 23, 2020 · 1 comment
Open

Buildpack support for Drupal 8 #253

badri opened this issue Aug 23, 2020 · 1 comment

Comments

@badri
Copy link

badri commented Aug 23, 2020

I'm attempting to build Drupal 8 using PHP buildpacks. Here's a breakdown of the steps I'm doing.

  1. Scaffold Drupal 8.
    composer create-project "drupal/recommended-project:^8" drupal

  2. Add the following buildpack.yml.

---
php:
  version: 7.4.*
  webserver: nginx
  webdirectory: web
  1. Build the container image.

pack build -b gcr.io/paketo-buildpacks/php drupal-8 --builder paketobuildpacks/builder:full

  1. Run the new image.

docker run --interactive --tty --env PORT=8080 --publish 8080:8080 drupal-8

The trouble is, the build process creates a symlink of the vendor directory, and running composer install post that updates the autoload.php thus:

<?php

/**
 * @file
 * Includes the autoloader created by Composer.
 *
 * This file was generated by drupal-scaffold.
 *.
 * @see composer.json
 * @see index.php
 * @see core/install.php
 * @see core/rebuild.php
 * @see core/modules/statistics/statistics.php
 */

return require __DIR__ . '//layers/paketo-buildpacks_php-composer/php-composer-packages/vendor/autoload.php';

Which breaks the autoload sequence.

When I edit it back to what it was,

<?php

/**
 * @file
 * Includes the autoloader created by Composer.
 *
 * This file was generated by drupal-scaffold.
 *.
 * @see composer.json
 * @see index.php
 * @see core/install.php
 * @see core/rebuild.php
 * @see core/modules/statistics/statistics.php
 */

return require __DIR__ . '/../vendor/autoload.php';

It works fine. I am not sure why we create symlinks and then run composer install again.

Copying the vendor directory instead of symlinking it would help, although there might be some rationale behind symlinking it which I'm not aware of.

Running composer install after symlinking updates the autoload.php files to reflect the new location of vendor directory.

Happy to triage any approaches/fixes and contribute back to the buildpack, and thanks for the awesome work.

@fg-j
Copy link

fg-j commented Nov 30, 2021

@paketo-buildpacks/php-maintainers This has been open for a bit. Any update on this? Does the workaround described in the replies to #366 also apply to this use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants