我必须迁移1000个网站。它们都基于相同的基本Drupal Docker映像。
不幸的是,当第二个映像生成时,作曲家开始删除由最初的作曲家运行安装的所有模块。我该如何解决?
$ cat denpal/Dockerfile.cli
FROM php:7.2-cli-drupal
COPY composer.json /app/
COPY scripts /app/scripts
RUN composer install --no-dev
COPY . /app
# Define where the Drupal Root is located
ENV WEBROOT=web
$ cat denpal-example/Dockerfile.cli
FROM testdevelopment/denpal
COPY composer.json /app/
RUN composer install --no-dev
COPY . /app
# Define where the Drupal Root is located
ENV WEBROOT=web
$ cat denpal/composer.json
{
"type": "project",
"license": "GPL-2.0+",
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
],
"require": {
"composer/installers": "^1.2",
"drupal-composer/drupal-scaffold": "^2.2",
"cweagans/composer-patches": "~1.0",
"drupal/core": "~8.0",
"drush/drush": "~8.0",
"drupal/console": "~1.0",
"drupal/config_installer": "1.x-dev",
"drupal/redis": "^1.0",
"drupal/poll": "1.2",
"drupal/search_api": "^1.6",
"drupal/search_api_solr": "^1.2",
"drupal/varnish_purge": "^1.10",
"drupal/purge": "^3.0"
},
"require-dev": {
"behat/mink": "~1.7",
"behat/mink-goutte-driver": "~1.2",
"jcalderonzumba/gastonjs": "~1.0.2",
"jcalderonzumba/mink-phantomjs-driver": "~0.3.1",
"mikey179/vfsstream": "~1.2",
"phpunit/phpunit": "~4.8",
"symfony/css-selector": "~2.8"
},
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"classmap": [
"scripts/composer/ScriptHandler.php"
]
},
"scripts": {
"drupal-scaffold": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
"pre-install-cmd": [
"DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
],
"pre-update-cmd": [
"DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
],
"post-install-cmd": [
"DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
],
"post-update-cmd": [
"DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
]
},
"extra": {
"installer-paths": {
"web/core": ["type:drupal-core"],
"web/libraries/{$name}": ["type:drupal-library"],
"web/modules/contrib/{$name}": ["type:drupal-module"],
"web/profiles/contrib/{$name}": ["type:drupal-profile"],
"web/themes/contrib/{$name}": ["type:drupal-theme"],
"drush/contrib/{$name}": ["type:drupal-drush"]
},
"drupal-scaffold": {
"excludes": [
"sites/development.services.yml",
"sites/example.settings.local.php"
]
}
}
}
运行此composer运行将删除以前的composer运行安装的所有软件包:
$ cat denpal-example/composer.json
{
"type": "project",
"license": "GPL-2.0+",
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
],
"require": {
"drutiny/drutiny": "2.3.*@dev"
}
}