diff --git a/RoboFileBase.php b/RoboFileBase.php index e3c6ae4..6732ca2 100644 --- a/RoboFileBase.php +++ b/RoboFileBase.php @@ -129,7 +129,6 @@ protected function readConfigFromEnv() { // Environment. $config['environment']['hash_salt'] = getenv('HASH_SALT'); - $config['environment']['config_sync_dir'] = getenv('CONFIG_SYNC_DIRECTORY'); // Clean up NULL values and empty arrays. $array_clean = function (&$item) use (&$array_clean) { @@ -155,7 +154,6 @@ public function build() { $start = new DateTime(); $this->devComposerValidate(); $this->buildMake(); - $this->buildCreateConfigSyncDir(); $this->buildSetFilesOwner(); $this->buildInstall(); $this->configImportPlus(); @@ -197,19 +195,6 @@ public function buildMake($flags = '') { $this->checkFail($successful, "Composer install failed."); } - /** - * Create the config sync directory from config. - * - * Drupal will write a .htaccess afterwards in there. - */ - public function buildCreateConfigSyncDir() { - if (isset($this->config['environment']['config_sync_dir'])) { - // Only do this if we have a config sync dir setting available. - $this->say("Creating config sync directory."); - $this->_exec("$this->sudo_cmd mkdir -p " . $this->config['environment']['config_sync_dir']); - } - } - /** * Set the owner and group of all files in the files dir to the web user. */ diff --git a/docker-compose.linux.yml b/docker-compose.linux.yml index 42fd0b6..df1284f 100644 --- a/docker-compose.linux.yml +++ b/docker-compose.linux.yml @@ -14,7 +14,6 @@ services: ports: - "80:8080" environment: - CONFIG_SYNC_DIRECTORY: /shared/private/random-hash/sync DATABASE_HOST: db DATABASE_USER: user DATABASE_PASSWORD: password @@ -25,6 +24,7 @@ services: PUBLIC_DIR: /shared/public REDIS_ENABLED: 1 REDIS_HOST: redis + # REDIS_PASSWORD: testing SHEPHERD_SITE_ID: 2 SHEPHERD_INSTALL_PROFILE: ua SHEPHERD_SECRET_PATH: /code/private @@ -66,6 +66,12 @@ services: redis: image: redis:alpine + command: | + redis-server + --maxmemory 512Mi + --maxmemory-policy allkeys-lru + --save "" + # --requirepass password networks: - default diff --git a/docker-compose.osx.yml b/docker-compose.osx.yml index c0a27cd..918cc90 100644 --- a/docker-compose.osx.yml +++ b/docker-compose.osx.yml @@ -18,11 +18,12 @@ services: - "9990:9990" - "11211:11211" environment: - CONFIG_SYNC_DIRECTORY: /shared/private/random-hash/sync HASH_SALT: random-hash MEMCACHE_ENABLED: 0 + PHP_IDE_CONFIG: serverName=localhost PUBLIC_DIR: /shared/public REDIS_ENABLED: 1 + # REDIS_PASSWORD: testing SHEPHERD_INSTALL_PROFILE: ua SHEPHERD_SITE_ID: 2 SHEPHERD_SECRET_PATH: /code/private @@ -33,7 +34,6 @@ services: SITE_ADMIN_EMAIL: admin@example.com SITE_ADMIN_USERNAME: admin SITE_ADMIN_PASSWORD: password - PHP_IDE_CONFIG: serverName=localhost XDEBUG_CONFIG: "remote_host=docker.for.mac.localhost" volumes: - nfsmount:/code @@ -61,6 +61,12 @@ services: redis: image: redis:alpine + command: | + redis-server + --maxmemory 512Mi + --maxmemory-policy allkeys-lru + --save "" + # --requirepass password network_mode: service:web memcached: diff --git a/dsh b/dsh index f43e6c5..7ec87ef 100755 --- a/dsh +++ b/dsh @@ -105,7 +105,8 @@ dsh_project() { # Command: ./dsh pull # Fetches all images used by the project. dsh_pull() { - docker-compose -f ${DOCKER_COMPOSE_FILE} pull + docker-compose -f ${DOCKER_COMPOSE_FILE} pull --ignore-pull-failures + docker-compose -f ${DOCKER_COMPOSE_FILE} build } # Command: ./dsh nfs diff --git a/src/Handler.php b/src/Handler.php index 2f8e043..b7feec1 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -162,7 +162,7 @@ public function generateSettings() "\$settings['file_private_path'] = getenv('PRIVATE_DIR') ?: '/shared/private';\n" . "\$settings['file_temporary_path'] = getenv('TMP_DIR') ?: '/shared/tmp';\n" . "\$settings['hash_salt'] = getenv('HASH_SALT') ?: '" . str_replace(['+', '/', '='], ['-', '_', ''], base64_encode(random_bytes(55))) . "';\n" . - "\$config_directories['sync'] = getenv('CONFIG_SYNC_DIRECTORY') ?: DRUPAL_ROOT . '/../config-export';\n" . + "\$config_directories['sync'] = DRUPAL_ROOT . '/../config-export';\n" . "\$settings['shepherd_site_id'] = getenv('SHEPHERD_SITE_ID');\n" . "\$settings['shepherd_url'] = getenv('SHEPHERD_URL');\n" . "\$settings['shepherd_token'] = getenv('SHEPHERD_TOKEN_FILE') ? file_get_contents(getenv('SHEPHERD_TOKEN_FILE')) : getenv('SHEPHERD_TOKEN');\n\n" . @@ -177,9 +177,12 @@ public function generateSettings() " \$settings['cache_prefix']['default'] = getenv('REDIS_PREFIX') ?: '';\n" . " // If we're not installing, include the redis services.\n" . " if (!isset(\$GLOBALS['install_state'])) {\n" . - " \$settings['cache']['default'] = 'cache.backend.redis';\n\n" . + " \$settings['cache']['default'] = 'cache.backend.redis';\n" . " \$settings['container_yamls'][] = 'modules/contrib/redis/example.services.yml';\n" . " }\n" . + " if (getenv('REDIS_PASSWORD_FILE') || getenv('REDIS_PASSWORD')) {\n" . + " \$settings['redis.connection']['password'] = getenv('REDIS_PASSWORD_FILE') ? file_get_contents(getenv('REDIS_PASSWORD_FILE')) : getenv('REDIS_PASSWORD');\n" . + " }\n" . "}\n" . "if (getenv('MEMCACHE_ENABLED')) {\n" . " \$settings['memcache']['servers'] = [getenv('MEMCACHE_HOST') . ':11211' => 'default'] ?: ['127.0.0.1:11211' => 'default'];\n" .