From dddafd862f6ff962ce5677f9fb8e4455ccf021b4 Mon Sep 17 00:00:00 2001 From: Fabio Tielen // Code Agency Date: Mon, 4 Sep 2023 23:54:39 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(.env.example):=20add=20configu?= =?UTF-8?q?ration=20options=20for=20Redis=20caching=20in=20the=20.env.exam?= =?UTF-8?q?ple=20file=20=E2=9C=A8=20feat(docker-compose.yml):=20add=20keyd?= =?UTF-8?q?b=20service=20for=20Redis=20caching=20with=201GB=20shared=20mem?= =?UTF-8?q?ory=20size=20=E2=9C=A8=20feat(odoo.example.conf):=20add=20confi?= =?UTF-8?q?guration=20options=20for=20Redis=20caching=20in=20the=20odoo.ex?= =?UTF-8?q?ample.conf=20file=20The=20changes=20were=20made=20to=20add=20su?= =?UTF-8?q?pport=20for=20Redis=20caching=20in=20the=20application.=20The?= =?UTF-8?q?=20.env.example=20file=20now=20includes=20configuration=20optio?= =?UTF-8?q?ns=20for=20Redis=20caching,=20such=20as=20Redis=20host,=20port,?= =?UTF-8?q?=20password,=20URL,=20prefix,=20expiration=20time,=20and=20expi?= =?UTF-8?q?ration=20time=20for=20anonymous=20sessions.=20The=20docker-comp?= =?UTF-8?q?ose.yml=20file=20now=20includes=20a=20keydb=20service=20with=20?= =?UTF-8?q?1GB=20shared=20memory=20size=20for=20Redis=20caching.=20The=20o?= =?UTF-8?q?doo.example.conf=20file=20now=20includes=20configuration=20opti?= =?UTF-8?q?ons=20for=20Redis=20caching,=20such=20as=20enabling=20Redis=20c?= =?UTF-8?q?aching,=20Redis=20host,=20port,=20password,=20URL,=20prefix,=20?= =?UTF-8?q?expiration=20time,=20and=20expiration=20time=20for=20anonymous?= =?UTF-8?q?=20sessions.=20These=20changes=20allow=20the=20application=20to?= =?UTF-8?q?=20utilize=20Redis=20for=20caching,=20improving=20performance?= =?UTF-8?q?=20and=20scalability.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 14 +++++++++++++- docker-compose.yml | 15 +++++++++++++++ odoo/odoo.example.conf | 20 ++++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 3974d52..a08ab2f 100644 --- a/.env.example +++ b/.env.example @@ -5,7 +5,7 @@ APP_ENV=local INIT= UPDATE= -LOAD=base,web +LOAD=base,web,session_redis WORKERS=2 DEV_MODE=reload,qweb DOMAIN=erp.odoocker.test @@ -235,3 +235,15 @@ CORS_ALLOWED_DOMAIN=${CORS_ALLOWED_DOMAIN} # ACME Companion # #----------------------# DEFAULT_EMAIL=${SUPPORT_EMAIL} + +#----------------------# +# REDIS Caching # +#----------------------# +ODOO_SESSION_REDIS = ${ODOO_SESSION_REDIS} +ODOO_SESSION_REDIS_HOST = ${ODOO_SESSION_REDIS_HOST} +ODOO_SESSION_REDIS_PORT = ${ODOO_SESSION_REDIS_PORT} +ODOO_SESSION_REDIS_PASSWORD = ${ODOO_SESSION_REDIS_PASSWORD} +ODOO_SESSION_REDIS_URL = ${ODOO_SESSION_REDIS_URL} +ODOO_SESSION_REDIS_PREFIX = ${ODOO_SESSION_REDIS_PREFIX} +ODOO_SESSION_REDIS_EXPIRATION = ${ODOO_SESSION_REDIS_EXPIRATION} +ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS = ${ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 171320c..3f9aec0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,6 +32,7 @@ services: args: - POSTGRES_TAG restart: unless-stopped + shm_size: 1GB tty: true volumes: - pg-data:${PGDATA} @@ -82,12 +83,26 @@ services: networks: - internal + keydb: + image: eqalpha/keydb:latest + platform: linux/amd64 + shm_size: 1GB + restart: unless-stopped + networks: + - internal + # command: keydb-server /etc/keydb/keydb.conf + volumes: + #- ./keydb.conf:/etc/keydb/keydb.conf:ro + - cache-db-data:/var/lib/keydb + volumes: data-dir: pg-data: certs: vhost: html: + cache-db-data: + networks: internal: diff --git a/odoo/odoo.example.conf b/odoo/odoo.example.conf index 30d8ee5..e935a0d 100644 --- a/odoo/odoo.example.conf +++ b/odoo/odoo.example.conf @@ -259,3 +259,23 @@ limit_time_real_cron = {LIMIT_TIME_REAL_CRON} ; --limit-request limit_request = {LIMIT_REQUEST} + +;------------------------------------------; +; Options not exposed on the command line. ; +;------------------------------------------; +; --ODOO_SESSION_REDIS +ODOO_SESSION_REDIS = {ODOO_SESSION_REDIS} ;has to be 1 or true +; --ODOO_SESSION_REDIS_HOST +ODOO_SESSION_REDIS_HOST = {ODOO_SESSION_REDIS_HOST} ;is the redis hostname (default is localhost) +; --ODOO_SESSION_REDIS_PORT +ODOO_SESSION_REDIS_PORT = {ODOO_SESSION_REDIS_PORT} ;is the redis port (default is 6379) +; --ODOO_SESSION_REDIS_PASSWORD +ODOO_SESSION_REDIS_PASSWORD = {ODOO_SESSION_REDIS_PASSWORD} ;is the password for the AUTH command (optional) +; -- ODOO_SESSION_REDIS_URL +ODOO_SESSION_REDIS_URL = {ODOO_SESSION_REDIS_URL} ;is an alternative way to define the Redis server address. It's the preferred way when you're using the rediss:// protocol. +; -- ODOO_SESSION_REDIS_PREFIX +ODOO_SESSION_REDIS_PREFIX = {ODOO_SESSION_REDIS_PREFIX} ;is the prefix for the session keys (optional) +; -- ODOO_SESSION_REDIS_EXPIRATION +ODOO_SESSION_REDIS_EXPIRATION = {ODOO_SESSION_REDIS_EXPIRATION} ;is the time in seconds before expiration of the sessions (default is 7 days) +; -- ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS +ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS = {ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS} ;the time in seconds before expiration of the anonymous sessions (default is 3 hours)