feat: new revision

This commit is contained in:
Janik von Rotz committed 2025-01-02 12:21:44 +01:00
1 parent 07ab5be4b8
commit ea0245690c
14 files changed
+93 -54

No files matched your search

+1
View File
@@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file. The format
* Image has env vars to initialize database.
* `test-docker` uses new env vars to initialize database.
* Extended usage section of Odoo Build README file.
* Use the prefixed `PG` env vars for database connection.
### Fixed
+7 -3
View File
@@ -87,6 +87,10 @@ RUN npm install -g rtlcss
RUN python3 -m venv /opt/odoo-venv
ENV PATH=/opt/odoo-venv/bin:$PATH
# Install Odoo tools
COPY ./build/requirements.txt /opt/odoo-venv/
RUN pip install --no-cache-dir -r /opt/odoo-venv/requirements.txt
# Install Odoo
COPY ./odoo /opt/odoo
RUN pip install --no-cache-dir -e /opt/odoo -r /opt/odoo/requirements.txt \
@@ -102,7 +106,7 @@ ENV ODOO_VERSION $ODOO_VERSION
# Copy entrypoint script and Odoo configuration file
COPY ./build/odoo.conf.template /etc/odoo/
COPY ./build/entrypoint.sh /
COPY ./build/parse-url /usr/local/bin/parse-url
COPY ./build/parse-url /usr/local/bin/
RUN chmod +x /usr/local/bin/parse-url
# Create a user named odoo
@@ -135,10 +139,10 @@ EXPOSE 8069 8071 8072
# Set the default config file
ENV ODOO_RC /etc/odoo/odoo.conf
COPY ./build/wait-for-psql.py /usr/local/bin/wait-for-psql.py
COPY ./build/wait-for-psql.py /usr/local/bin/
# Set default user when running the container
USER odoo
ENTRYPOINT ["/entrypoint.sh"]
CMD ["odoo"]
CMD ["odoo"]
+44 -23
View File
@@ -3,15 +3,15 @@
A better Odoo image.
- Ships with python 3.11
- Odoo source is based on exact git revision
- Odoo source is based on exact [revision](https://odoo.build/revisions.html)
- Setup `odoo.conf` with environment vars
- Clone addons from git repos
- Install pip packages without building the image
- Detects addons in nested module folders
- Detect addons in nested module folders
- Store session information in database
- Get environment name from server config
- Initialize database with selected modules
- Auto update modules that have changed
- Built-in [manifestoo](https://github.com/acsone/manifestoo) and [click-odoo-contrib](https://github.com/acsone/click-odoo-contrib)
Source: <https://github.com/Mint-System/Odoo-Build/tree/16.0/build>
@@ -22,14 +22,14 @@ version: "3"
services:
odoo:
container_name: odoo
image: mintsystem/odoo:16.0.20241125
image: mintsystem/odoo:16.0.20241220
depends_on:
- db
environment:
HOST: db
USER: odoo
PASSWORD: odoo
PORT: 5432
PGHOST: db
PGUSER: odoo
PGPASSWORD: odoo
PGPORT: 5432
GIT_SSH_PUBLIC_KEY: ssh-ed25519 BBBBC3NzaC1lZDI1NTE5BBBBIDR9Ibi0mATjCyx1EYg594oFkY0rghtgo+pnFHOvAcym Mint-System-Project-MCC@github.com
GIT_SSH_PRIVATE_KEY: |
-----BEGIN OPENSSH PRIVATE KEY-----
@@ -43,9 +43,8 @@ services:
ODOO_DATABASE: 16.0
ODOO_INIT: True
ODOO_INIT_LANG: de_CH
ODOO_ADDONS_AUTO_UPDATE: True
ENVIRONMENT: production
PIP_INSTALL: postgres-client,manifestoo
PIP_INSTALL: prometheus-client
SERVER_WIDE_MODULES: web,session_db
SESSION_DB_URI: postgres://odoo:odoo@db/16.0
PROXY_MODE: True
@@ -83,10 +82,10 @@ volumes:
Odoo supports PostgreSQL database only.
* `HOST` Name of the database container.
* `USER` Database username.
* `PASSWORD` Database user password.
* `PORT` Postgres server port. Default is `5432`.
* `PGHOST` Name of the database container.
* `PGUSER` Database username.
* `PGPASSWORD` Database user password.
* `PGPORT` Postgres server port. Default is `5432`.
### Module Repos
@@ -96,18 +95,20 @@ The entrypoint script can clone git repositories.
* `GIT_SSH_PRIVATE_KEY` Private key for SSH connection.
* `ADDONS_GIT_REPOS` Comma seperated list of git clone urls appended with `#` and branch name.
### Addons
### Addons Path
The entrypoint script searches for module folders in the addons paths and creates a new addons path.
The entrypoint script searches for module folders in the addons path and creates a new addons path.
* `ODOO_ADDONS_PATH` Comma seperated list of container paths pointing to addon folders.
### Initialize
If enabled the entrypoint script initializes the Odoo database.
* `ODOO_ADDONS_PATH` Comma seperated list of container paths to the addons folders.
* `ODOO_DATABASE` Name of the Odoo database. Default is `odoo`.
* `ODOO_INIT` Enable to initalise the database. Default is `False`.
* `ODOO_INIT_LANG` Language used for database initialisation. Default is `en_US`.
* `ODOO_INIT_ADDONS` Provide comma separated list of modules for database initialisation. Default is `web`.
* `ODOO_ADDONS_AUTO_UPDATE` Detect file changes in module folders and update modules that changed. Default is `False`.
The default login is `admin:admin`.
### Server Environment
@@ -147,16 +148,36 @@ Here are the most important container paths.
* `/opt/odoo-venv` This is where Python packages are installed.
* `/mnt/extra-addons` Module folders are loaded from this path by default.
### Mainfestoo
With the Manifestoo cli you can query the module manifests files.
List all modules:
```bash
docker exec odoo manifestoo --select-found list
```
### click-odoo
With the click-odoo you can manage the Odoo database.
Update all modules that have changed:
```bash
docker exec odoo bash -c "click-odoo-update \$(grep addons_path /etc/odoo/odoo.conf | sed 's/addons_path = /--addons-path=/') -d odoo
```
## Develop
As with every Docker image this image can be updated.
### Install packages
Extend the image with additional Python packages.
Extend the image with Python packages.
```dockerfile
FROM mintsystem/odoo:16.0.20241125
FROM mintsystem/odoo:16.0.20241220
RUN pip install prometheus-client astor fastapi python-multipart ujson a2wsgi parse-accept-language pyjwt
```
@@ -166,7 +187,7 @@ RUN pip install prometheus-client astor fastapi python-multipart ujson a2wsgi pa
Copy a custom Odoo conf file to the image.
```dockerfile
FROM mintsystem/odoo:16.0.20241125
FROM mintsystem/odoo:16.0.20241220
COPY ./odoo.conf.template /etc/odoo/
```
+22 -19
View File
@@ -99,32 +99,35 @@ set_odoo_config_env() {
# Remove duplicate module paths
ODOO_ADDONS_PATH=$(echo "$ODOO_ADDONS_PATH" | tr "," "\n" | sort -u | tr "\n" "," | sed 's/,$//')
fi
GIT_SSH_PRIVATE_KEY=$(echo -e "$GIT_SSH_PRIVATE_KEY" | base64 -w0)
export GIT_SSH_PRIVATE_KEY
export GIT_SSH_PUBLIC_KEY
: "${ENVIRONMENT:=development}"
export ENVIRONMENT
: "${SERVER_WIDE_MODULES:=web}"
export SERVER_WIDE_MODULES
: "${PROXY_MODE:=False}"
export PROXY_MODE
: "${LOG_LEVEL:=info}"
export LOG_LEVEL
: "${LIST_DB:=True}"
export LIST_DB
: "${ADMIN_PASSWD:=odoo}"
export ADMIN_PASSWD
: "${DBFILTER:=.*}"
export DBFILTER
: "${ENVIRONMENT:=development}"
export ENVIRONMENT
: "${LIST_DB:=True}"
export LIST_DB
: "${PROXY_MODE:=False}"
export PROXY_MODE
: "${WORKERS:=0}"
export WORKERS
: "${SERVER_WIDE_MODULES:=web}"
export SERVER_WIDE_MODULES
: "${LIMIT_REQUEST:=8192}"
export LIMIT_REQUEST
: "${LIMIT_TIME_CPU:=60}"
export LIMIT_TIME_CPU
: "${LIMIT_TIME_REAL:=120}"
export LIMIT_TIME_REAL
GIT_SSH_PRIVATE_KEY=$(echo -e "$GIT_SSH_PRIVATE_KEY" | base64 -w0)
export GIT_SSH_PRIVATE_KEY
export GIT_SSH_PUBLIC_KEY
}
set_odoo_config_env
@@ -158,10 +161,10 @@ pip_install
# set the postgres database host, port, user and password according to the environment
# and pass them as arguments to the odoo process if not present in the config file
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
: ${PGHOST:=${DB_PORT_5432_TCP_ADDR:='db'}}
: ${PGPORT:=${DB_PORT_5432_TCP_PORT:=5432}}
: ${PGUSER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
: ${PGPASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
DB_ARGS=()
function check_config() {
@@ -173,10 +176,10 @@ function check_config() {
DB_ARGS+=("--${param}")
DB_ARGS+=("${value}")
}
check_config "db_host" "$HOST"
check_config "db_port" "$PORT"
check_config "db_user" "$USER"
check_config "db_password" "$PASSWORD"
check_config "db_host" "$PGHOST"
check_config "db_port" "$PGPORT"
check_config "db_user" "$PGUSER"
check_config "db_password" "$PGPASSWORD"
init_db() {
: "${ODOO_DATABASE:=odoo}"
+2
View File
@@ -0,0 +1,2 @@
manifestoo
click-odoo-contrib
+4 -1
View File
@@ -10,6 +10,10 @@ services:
USER: odoo
PASSWORD: odoo
PORT: ${POSTGRES_PORT}
PGHOST: db
PGUSER: odoo
PGPASSWORD: odoo
PGPORT: ${POSTGRES_PORT}
GIT_SSH_PUBLIC_KEY: ${GIT_SSH_PUBLIC_KEY}
GIT_SSH_PRIVATE_KEY: ${GIT_SSH_PRIVATE_KEY}
ADDONS_GIT_REPOS: ${ADDONS_GIT_REPOS}
@@ -18,7 +22,6 @@ services:
ODOO_INIT: ${ODOO_INIT}
ODOO_INIT_LANG: ${ODOO_INIT_LANG}
ODOO_INIT_ADDONS: ${ODOO_INIT_ADDONS}
ODOO_ADDONS_AUTO_UPDATE: ${ODOO_ADDONS_AUTO_UPDATE}
ENVIRONMENT: ${ENVIRONMENT}
PIP_INSTALL: ${PIP_INSTALL}
SERVER_WIDE_MODULES: ${SERVER_WIDE_MODULES}
+1 -1
Submodule odoo updated: c666e18295...ced51f4db7.
+5
View File
@@ -0,0 +1,5 @@
ODOO_REVISION=16.0.20241220
ODOO_REF=b2e2927db2bd23310deefea17edec18e7683d278
ODOO_ENTERPRISE_REF=c30ec470ed1441c89b80632cc68f610b46096786
ODOO_THEME_REF=6681d6cc6d72a5f1cfb242846713cc92fee83f28
ODOO_DOCKER_REF=odoo@sha256:f815afc0a7635ef5e34b2031f27cb8b7b15b242dd59f001cc380386328a5a629
+2 -2
View File
@@ -552,7 +552,7 @@ function build() {
docker image rm "${DOCKER_REGISTRY}${DOCKER_TAG}"
ODOO_DATE=""
if [[ "ODOO_REVISION" != "GIT_BRANCH" ]]; then
if [[ "ODOO_REVISION" != "$GIT_BRANCH" ]]; then
ODOO_DATE=$(echo "$ODOO_REVISION" | cut -d'.' -f3-)
fi
@@ -858,7 +858,7 @@ function test-docker() {
export ODOO_INIT=True
export ODOO_INIT_LANG=de_CH
export ODOO_INIT_ADDONS=server_environment_ir_config_parameter,prometheus_exporter,mail_server_filter,git_base,contacts,web_enterprise
export ODOO_INIT_ADDONS=server_environment_ir_config_parameter,module_auto_update,prometheus_exporter,mail_server_filter,git_base,contacts,web_enterprise
start
}
+1 -1
Submodule themes updated: fe91239586...6681d6cc6d.