Skip to content

Commit

Permalink
Merge pull request #410 from UN-OCHA/local-stack-update-for-consistency
Browse files Browse the repository at this point in the history
chore: update local stack for consistency
  • Loading branch information
orakili authored Dec 4, 2023
2 parents f0c4e4c + 31492cd commit ce4a343
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
6 changes: 3 additions & 3 deletions local/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ IMAGE_TAG=local

SITE_DOMAIN=unocha-local.test

MYSQL_DB=unocha-local
MYSQL_USER=unocha-local
MYSQL_PASS=unocha-local
MYSQL_DB=unocha
MYSQL_USER=unocha
MYSQL_PASS=unocha

PHP_ENVIRONMENT=local

Expand Down
2 changes: 1 addition & 1 deletion local/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ After modifications to the composer files (for example, after the automatic comp

When a new image used by a service has been created by the OPS team (ex: new mysql or php image):

- Run `./local/insall.sh -u -d` to pull the service and base site images, recreate the local site image and the containers and install the dev dependencies.
- Run `./local/install.sh -u -d` to pull the service and base site images, recreate the local site image and the containers and install the dev dependencies.

When an image **with a new tag** has been created, then update the `local/docker-compose.yml` or the `docker/Dockerfile` accordingly before running the update command above.

Expand Down
2 changes: 2 additions & 0 deletions local/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ services:
# Mount volumes for the private and public files.
- "site-public:/srv/www/html/sites/default/files:rw"
- "site-private:/srv/www/html/sites/default/private:rw"
# A place for database backups to be installed.
- "../database:/srv/www/database:ro"
# Mount the folders needed for the tests.
- "../phpcs.xml:/srv/www/phpcs.xml:ro"
- "../phpunit.xml:/srv/www/phpunit.xml:ro"
Expand Down
1 change: 0 additions & 1 deletion local/shared/settings/settings.local.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,3 @@
$settings['cache']['bins']['page'] = 'cache.backend.null';
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
}

28 changes: 19 additions & 9 deletions local/shared/settings/settings.memcache.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

// Memcache.
if (file_exists('sites/default/memcache.services.yml')) {
// Add our memcache services definitions. This file is added by the docker build.
// Add our memcache services definitions. This file is added by the docker
// build.
$settings['container_yamls'][] = 'sites/default/memcache.services.yml';
// Add our memcache services definitions.
if (file_exists('modules/contrib/memcache/memcache.services.yml')) {
Expand All @@ -31,11 +32,12 @@
// Stick the bootstrap container in memcache, too!
$class_loader->addPsr4('Drupal\\memcache\\', 'modules/contrib/memcache/src');

// Define custom bootstrap container definition to use Memcache for cache.container.
// Define custom bootstrap container definition to use Memcache for
// 'cache.container'.
$settings['bootstrap_container_definition'] = [
'parameters' => [],
'services' => [
# Dependencies.
// Dependencies.
'settings' => [
'class' => 'Drupal\Core\Site\Settings',
'factory' => 'Drupal\Core\Site\Settings::getInstance',
Expand All @@ -58,29 +60,37 @@
],
'memcache.timestamp.invalidator.bin' => [
'class' => 'Drupal\memcache\Invalidator\MemcacheTimestampInvalidator',
# Adjust tolerance factor as appropriate when not running memcache on localhost.
// Adjust tolerance factor as appropriate when not running memcache on
// localhost.
'arguments' => ['@memcache.factory', 'memcache_bin_timestamps', 0.001],
],
'memcache.timestamp.invalidator.tag' => [
'class' => 'Drupal\memcache\Invalidator\MemcacheTimestampInvalidator',
# Remember to update your main service definition in sync with this!
# Adjust tolerance factor as appropriate when not running memcache on localhost.
// Remember to update your main service definition in sync with this!
// Adjust tolerance factor as appropriate when not running memcache on
// localhost.
'arguments' => ['@memcache.factory', 'memcache_tag_timestamps', 0.001],
],
'memcache.backend.cache.container' => [
'class' => 'Drupal\memcache\DrupalMemcacheInterface',
'factory' => ['@memcache.factory', 'get'],
# Actual cache bin to use for the container cache.
// Actual cache bin to use for the container cache.
'arguments' => ['container'],
],
# Define a custom cache tags invalidator for the bootstrap container.
// Define a custom cache tags invalidator for the bootstrap container.
'cache_tags_provider.container' => [
'class' => 'Drupal\memcache\Cache\TimestampCacheTagsChecksum',
'arguments' => ['@memcache.timestamp.invalidator.tag'],
],
'cache.container' => [
'class' => 'Drupal\memcache\MemcacheBackend',
'arguments' => ['container', '@memcache.backend.cache.container', '@cache_tags_provider.container', '@memcache.timestamp.invalidator.bin', '@datetime.time'],
'arguments' => [
'container',
'@memcache.backend.cache.container',
'@cache_tags_provider.container',
'@memcache.timestamp.invalidator.bin',
'@datetime.time',
],
],
],
];
Expand Down

0 comments on commit ce4a343

Please sign in to comment.