From de7df2bb51ecd068d3eae6cf314b20c744e96927 Mon Sep 17 00:00:00 2001 From: Bin Yang Date: Mon, 21 Mar 2022 22:40:51 +0800 Subject: memcached container as sidecar To fix the dependency on memcached which depends on the GPLv3 licensed gdbm indirectly, Use sidecar to integrate memcached from dockerhub Add docker-composer scripts to support local test Issue-ID: MULTICLOUD-1457 Signed-off-by: Bin Yang Change-Id: I55a156c0af158535dccfa87e7b9603e47be4d9c1 --- starlingx/starlingx/settings.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'starlingx/starlingx/settings.py') diff --git a/starlingx/starlingx/settings.py b/starlingx/starlingx/settings.py index d5362e4b..c19e8571 100644 --- a/starlingx/starlingx/settings.py +++ b/starlingx/starlingx/settings.py @@ -80,14 +80,25 @@ TIME_ZONE = 'UTC' # https://docs.djangoproject.com/en/1.6/howto/static-files/ STATIC_URL = '/static/' +MEMCACHED_HOST = os.environ.get('MEMCACHED_HOST', '127.0.0.1') +MEMCACHED_PORT = os.environ.get('MEMCACHED_PORT', '11211') +DEFAULT_CACHE_BACKEND_LOCATION = "%s:%s" % (MEMCACHED_HOST, MEMCACHED_PORT) CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', - 'LOCATION': '127.0.0.1:11211', + 'LOCATION': DEFAULT_CACHE_BACKEND_LOCATION, } } +# [RABBITMQ] +RABBITMQ_DEFAULT_USER = os.environ.get('RABBITMQ_DEFAULT_USER', 'guest') +RABBITMQ_DEFAULT_PASS = os.environ.get('RABBITMQ_DEFAULT_PASS', 'guest') +RABBITMQ_HOST = os.environ.get('RABBITMQ_HOST', 'localhost') +RABBITMQ_PORT = os.environ.get('RABBITMQ_PORT', '5672') +RABBITMQ_URL = "amqp://%s:%s@%s:%s//" % ( + RABBITMQ_DEFAULT_USER, RABBITMQ_DEFAULT_PASS, RABBITMQ_HOST, RABBITMQ_PORT) + # [MSB] DEFAULT_MSB_PROTO = "http" MSB_SERVICE_PROTOCOL = os.environ.get('MSB_PROTO', DEFAULT_MSB_PROTO) -- cgit 1.2.3-korg