From 41911982a9fda1d4c1e4b6c229f88e1ff06576f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Cabrera?= Date: Thu, 4 Jul 2024 20:35:28 +0100 Subject: [PATCH 1/2] docs: reorder vars --- README.md | 31 ++++++++++++++----------------- entrypoint.sh | 3 --- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 5711076..42a43bb 100644 --- a/README.md +++ b/README.md @@ -38,41 +38,37 @@ same name in lower case: | ENV var | Default value | | --- | --- | -| `ODOO_DB_USER` | `odoo` | -| `LOG_HANDLER` | `"[':INFO']"` | -| `LOG_LEVEL` | `info` | -| `LOG_DB` | `False` | -| `LOGFILE` | `"/var/log/odoo"` | -| `LOGROTATE` | `True` | -| `CSV_INTERNAL_SEP` | `";"` | | `ADMIN_PASSWD` | `admin` | -| `DB_HOST` | `localhost` | +| `CSV_INTERNAL_SEP` | `";"` | +| `DATA_DIR` | `/var/lib/odoo` | +| `DB_HOST` | `db` | +| `DB_FILTER` | `"^%d"` | +| `DB_MAXCONN` | `64` | +| `DB_NAME` | `False` | +| `DB_PASSWORD` | `odoo` | | `DB_PORT` | `5432` | | `DB_USER` | `odoo` | -| `DB_PASSWORD` | `odoo` | | `DB_TEMPLATE` | `template1` | -| `DB_NAME` | `False` | -| `DB_MAXCONN` | `64` | -| `DB_FILTER` | `"^%d"` | -| `DB_MAXCONN` | `64` | | `DEBUG_MODE` | `False` | | `EMAIL_FROM` | `False` | +| `GEVENT_PORT` | `8072` | | `LIMIT_MEMORY_HARD` | `2684354560` | | `LIMIT_MEMORY_SOFT` | `2147483648` | | `LIMIT_REQUEST` | `8192` | | `LIMIT_TIME_CPU` | `60` | | `LIMIT_TIME_REAL` | `120` | | `LIST_DB` | `True` | -| `LONGPOLLING_PORT` | `8072` | +| `LOG_DB` | `False` | +| `LOG_HANDLER` | `"[':INFO']"` | +| `LOG_LEVEL` | `info` | +| `LOGROTATE` | `True` | | `MAX_CRON_THREADS` | `2` | -| `OSV_MEMORY_AGE_LIMIT` | `1` | | `OSV_MEMORY_COUNT_LIMIT` | `False` | -| `PG_PATH` | `None` | | `PIDFILE` | `None` | | `PROXY_MODE` | `False` | | `REPORTGZ` | `False` | | `SECURE_CERT_FILE` | `"server.cert"` | -| `SECURE_pkey_FILE` | `"server.pkey"` | +| `SECURE_PKEY_FILE` | `"server.pkey"` | | `SERVER_WIDE_MODULES` | `None` | | `SMTP_PASSWORD` | `False` | | `SMTP_PORT` | `25` | @@ -85,6 +81,7 @@ same name in lower case: | `TEST_FILE` | `False` | | `TEST_REPORT_DIRECTORY` | `False` | | `TIMEZONE` | `False` | +| `TRANSIENT_AGE_LIMIT` | `1` | | `TRANSLATE_MODULES` | `"['all']"` | | `UNACCENT` | `True` | | `WITHOUT_DEMO` | `True` | diff --git a/entrypoint.sh b/entrypoint.sh index b9842f3..c56c2a2 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -57,9 +57,6 @@ set -e : ${XMLRPC_PORT:="8069"} : ${XMLRPCS:="True"} : ${XMLRPCS_PORT:="8071"} -# Estas no las estabamos metiendo: - ## echo 'logfile = '${LOGFILE:-"/var/log/odoo/odoo-server.log"} >> /opt/config/odoo-server.conf; \ - ## echo 'pg_path = '${PG_PATH:-None} >> /opt/config/odoo-server.conf; \ function write_conf() { param="$1" From 89e2b230fd9cfb8b45495547ccc9fab018de950e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Cabrera?= Date: Thu, 4 Jul 2024 23:21:44 +0100 Subject: [PATCH 2/2] fix: adjust dir structure --- Dockerfile | 7 +------ README.md | 14 +++++++++++--- docker-compose.yml | 14 +++++++++----- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 973697b..87f8c5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ # DOCKER image to run odoo 16 with Odoo Community Backports and OCA addons -# WARNING: No work done yet for 16, this is a dummy release to keep track of -# it and move onto 16. Do not use. FROM rubencabrera/odoo-base-image:16.0.1 MAINTAINER Rubén Cabrera Martínez EXPOSE 8069 8071 8072 @@ -10,15 +8,12 @@ ENV LANG C.UTF-8 RUN mkdir /opt/odoo; \ mkdir /var/log/odoo; \ mkdir /var/lib/odoo; \ - mkdir /opt/repos; \ mkdir -p /opt/repos/oca; \ mkdir -p /opt/repos/other RUN useradd --home /opt/odoo --shell /bin/bash odoo RUN chown -R odoo:odoo /opt/odoo; chown -R odoo:odoo /var/lib/odoo; \ chown -R odoo:odoo /var/log/odoo; chown -R odoo:odoo /opt/repos -# Con lo siguiente, cambiamos al usuario odoo y el path donde ejecuta los -# comandos que se indiquen después. USER odoo WORKDIR /opt/odoo RUN git clone --branch 16.0 --depth 1 https://github.com/oca/ocb.git /opt/odoo @@ -90,7 +85,7 @@ WORKDIR /opt USER root RUN mkdir /opt/config COPY ./odoo-server.conf /opt/config/odoo-server.conf -ENV OPENERP_SERVER /opt/config/odoo-server.conf +ENV OPENERP_SERVER_CONF /opt/config/odoo-server.conf RUN chown -R odoo:odoo /opt/config RUN sed -i '/^#.*Storage/s/^#//' /etc/systemd/journald.conf diff --git a/README.md b/README.md index 42a43bb..81baf3b 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,17 @@ be much better with something above 4GB. ## Running with docker-compose -Run `docker-compose up` in the root path. - -## Environment variables +1. Set the environment variables used in `docker-compose.yml` to +configure how docker compose will behave: +`ODOO_DOCKER_PROJECT_NAME` and `ODOO_DOCKER_REPOS_HOST_PATH`. +1. Review other `FIXME`s in that same file (like creating or setting the path +for your code volume). +1. Set other environment variables in the odoo16 container for the Odoo server +config (see section below, look at `DB_FILTER` especially for local + development). +1. Run `docker-compose up` in the root path. + +## Odoo server config using environment variables Odoo uses a config file that is a bit of a pain with a docker container. This images allow you to pass those config values in diff --git a/docker-compose.yml b/docker-compose.yml index a7178d2..31c69fc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,24 +51,28 @@ services: db: condition: service_healthy restart: true - image: "rubencabrera/odoo-docker:16.0.5" + environment: + - DB_FILTER=.* + image: "rubencabrera/odoo-docker:16.1.0" ports: - "8069:8069" - "8071:8071" - "8072:8072" restart: always volumes: - - code_volume:/opt + - code_volume:/opt/repos - odoo_data:/var/lib/odoo volumes: code_volume: - # This is where the code will live. + # This is where the code will live. For local development, you might want + # to use something owned by your user. driver: local driver_opts: o: bind type: none - # FIXME: The local paths need to exist for volumes to be mounted - device: ${ODOO_DOCKER_OPT_HOST_PATH:-${HOME}/.odoo_docker_opt} + # FIXME: The local paths need to exist for volumes to be mounted. + # For prod environments, this might be better inside a dir in `/opt` + device: ${ODOO_DOCKER_REPOS_HOST_PATH:-${HOME}/.${COMPOSE_PROJECT_NAME}_repos} name: ${COMPOSE_PROJECT_NAME}_code data_storage: name: ${COMPOSE_PROJECT_NAME}_data_storage