
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这段话即可:
请先阅读并遵守:https://xuanyuan.cloud/agents.md
未读文档前不要生成 pull 命令或排错方案。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
A better Odoo image.
This container image is an improvement of the official Odoo image:
odoo.conf is done through environment variables.Source: https://github.com/Mint-System/Odoo-Build/tree/main/images/odoo/
Changelog: <[***]>
The Mint System Odoo image runs with a very basic configuration, but can also be highly customized with environment variables.
Supported tags:
The following compose.yml shows a minimal setup:
ymlservices: odoo: container_name: odoo image: mintsystem/odoo:18.0 depends_on: - db environment: PGHOST: db PGUSER: odoo PGPASSWORD: odoo DB_NAME: odoo ports: - "127.0.0.1:8069:8069" volumes: - odoo-data:/var/lib/odoo db: container_name: db image: postgres:16-alpine environment: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoo PGDATA: /var/lib/postgresql/data/pgdata volumes: - db-data:/var/lib/postgresql/data/pgdata volumes: odoo-data: db-data:
This compose.yml shows all possible configurations:
ymlservices: odoo: container_name: odoo image: mintsystem/odoo:18.0 depends_on: db: condition: service_healthy environment: PGHOST: db PGUSER: odoo PGPASSWORD: odoo PGPORT: 5432 DB_NAME: odoo DB_MAXCONN: 128 PGSSLMODE: verify-ca PGSSLROOTCERT: /mnt/postgres-secret/ca.crt SMTP_SERVER: mail.infomaniak.com SMTP_PORT: 587 SMTP_SSL: True SMTP_USER: odoo@yourcompany.com SMTP_PASSWORD: ***** EMAIL_FROM: odoo@yourcompany.com MAIL_BOUNCE_ALIAS: bounce MAIL_CATCHALL_ALIAS: reply MAIL_CATCHALL_DOMAIN: yourcompany.com MAIL_DEFAULT_FROM: odoo MAIL_ALIAS_DOMAIN: yourcompany.com ODOO_MAIL_SMTP_HOST: mail.infomaniak.com ODOO_MAIL_SMTP_PORT: 587 ODOO_MAIL_SMTP_ENCRYPTION: starttls ODOO_MAIL_SMTP_FROM_FILTER: odoo@yourcompany.com ODOO_MAIL_IMAP_HOST: mail.infomaniak.com ODOO_MAIL_IMAP_PORT: 993 ODOO_MAIL_IMAP_SSL: True ODOO_MAIL_USERNAME: odoo@yourcompany.com ODOO_MAIL_PASSWORD: ***** GIT_AUTHOR_NAME: "Your Name" GIT_AUTHOR_EMAIL: you@example.com GIT_SSH_PUBLIC_KEY: "ssh-ed25519 BBBBC3NzaC1lZDI1NTE5BBBBIDR9Ibi0mATjCyx1EYg594oFkY0rghtgo+pnFHOvAcym Mint-System-Project-MCC@github.com" GIT_SSH_PRIVATE_KEY: "LS0tLS1CRUdJTiBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLQpiM0JsYm5OemFDMXJaWGt0ZGpFQUFBQUFCRzV2Ym1VQUFBQUVibTl1WlFBQUFBQUFBQUFCQUFBQU13QUFBQXR6YzJndFpXClF5TlRVeE9RQUFBQ0EwZlNHNHRKZ0U0d3NzZFJHSU9mZUtCWkdOSzRJYllLUHFaeFJ6cndITXBnQUFBS2k1WkJhRnVXUVcKaFFBQUFBdHpjMmd0WldReU5UVXhPUUFBQUNBMGZTRzR0SmdFNHdzc2RSR0lPZmVLQlpTks0SWJZS1BxWnhSenJ3SE1wZwowQkFnTT0KLS0tLS1FTkQgT1BFTlNTSCBQUklWQVRFIEtFWS0tLS0tCg==" SSH_ID_ALGORITHM: id_ed25519 GITHUB_USERNAME: bot-mintsys GITHUB_PAT: ***** GITLAB_URL: https://gitlab.com GITLAB_USERNAME: bot-mintsys GITLAB_PAT: ***** FORGEJO_URL: https://codeberg.org FORGEJO_USERNAME: bot-mintsys FORGEJO_PAT: ***** ADDONS_GIT_REPOS: | git@github.com:Mint-System/Odoo-Apps-Server-Tools#18.0 git@github.com:OCA/server-tools#18.0 ODOO_ADDONS_PATH: /mnt/addons/,/mnt/enterprise/,/mnt/oca/,/mnt/themes/ ODOO_ENTERPRISE_PATH: /mnt/enterprise ODOO_INIT_LOGIN: odoo ODOO_INIT_PASSWORD: ***** ODOO_INIT_LANG: de_CH ODOO_INIT_ADDONS: server_environment_ir_config_parameter RUNNING_ENV: production WITHOUT_DEMO: False PYTHON_INSTALL: | prometheus-client pyjwt SERVER_WIDE_MODULES: session_db,module_change_auto_install SESSION_DB_URI: postgres://odoo:odoo@db/18.0 PROXY_MODE: False LOG_LEVEL: debug MAX_CRON_THREADS: 4 LIST_DB: True LOG_DB: True LOG_HANDLER: ':INFO' LOGFILE: None ADMIN_PASSWD: ***** DB_FILTER: ^%d$ WORKERS: 4 LIMIT_REQUEST: 16384 LIMIT_TIME_CPU: 300 LIMIT_TIME_REAL: 600 LIMIT_MEMORY_HARD: 2684354560 LIMIT_MEMORY_SOFT: 2147483648 LIMIT_MEMORY_HARD_GEVENT: 1048579 LIMIT_MEMORY_SOFT_GEVENT: 1048576 MODULE_AUTO_INSTALL_DISABLED: odoo_test_xmlrunner TEST_ADDONS_DIR: /mnt/oca/partner-contact TEST_INCLUDE: partner_firstname TEST_EXCLUDE: partner_fax AUTO_UPDATE_TRANSLATIONS: True AUTO_UPDATE_MODULES_LIST: True ADDITIONAL_ODOO_RC: "syslog = True" IR_CONFIG_PARAMETER: "web.base.url = https://odoo.example.com" db_user_FILE: /run/secrets/db_user db_password_FILE: /run/secrets/db_password secrets: - db_user - db_password ports: - "127.0.0.1:8069:8069" volumes: - odoo-data:/var/lib/odoo - ./addons:/mnt/addons - ./oca:/mnt/oca - ./enterprise:/mnt/enterprise - ./themes:/mnt/themes db: container_name: db image: postgres:16-alpine environment: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoo PGDATA: /var/lib/postgresql/data/pgdata volumes: - db-data:/var/lib/postgresql/data/pgdata healthcheck: test: ["CMD-SHELL", "pg_isready -U odoo -d $DB_NAME"] interval: 5s timeout: 5s retries: 5 volumes: odoo-data: db-data: secrets: db_user: file: ./secrets/db_user.txt db_password: file: ./secrets/db_password.txt
The environment variables are explained in detail further down.
The Mint System Odoo image makes preparing and running Odoo very easy.
Initalize
Before starting the container you can initalize the database with these actions:
Run
After the entrypoint script is executed you can install and update modules:
Develop
Check the state of modules or run tests.
Run the clone-git-addons or aggregate-git-repos script to clone module repos:
bashdocker compose exec odoo clone-git-addons docker compose exec odoo aggregate-git-repos
Run the download-odoo-enterprise script to download the https://github.com/odoo/enterprise/:
bashdocker compose exec odoo download-odoo-enterprise
This script downloads an archive with GITHUB_USERNAME and GITHUB_PAT. With a git url in ODOO_ENTERPRISE_URL it checks out a shallow git repo with GIT_SSH_PRIVATE_KEY instead. The image has a pre-defined ODOO_ENTERPRISE_REF and ODOO_ENTERPRISE_PATH.
Run the init-db script to initalize the Odoo database:
bashdocker compose exec odoo init-db
All scripts use DB_NAME as target database.
Once you start the container the entrypoint.sh script will:
template-odoo-rc script to template the odoo.conf file.set-addons-path.install-python-packages script to install the Python packages.update-modules-list script if enabled.update-translations script if enabled.Once the container is running, install modules with:
bashdocker compose exec odoo init-module partner_firstname
Or update specific modules with this command:
bashdocker compose exec odoo update-module partner_firstname
There is also the option to update all modules:
bashdocker compose exec odoo update-modules
The update-modules command useshttps://github.com/acsone/click-odoo-contrib to update all Odoo modules. On the first run each installed module is updated and a checksum is computed and stored in the database. On subsequent executions the update is only performed for modules with a different checksum.
With the https://github.com/acsone/manifestoo cli you can query the module manifest files.
List all modules:
bashdocker exec odoo bash -c "manifestoo --select-found list --separator=,"
The run-tests script runs module tests and produces a coverage.xml file.
But first the server environment must be prepared to run tests.
bashdocker exec odoo setup-tests
Once this command is finished, run the module tests.
bashdocker exec odoo run-tests
The container can be configured with environment variables. This section shows all the variables in detail:
Odoo supports the PostgreSQL database only.
PGHOST Name of the database container.PGUSER Database username.PGPASSWORD Database user password.PGPORT Postgres server port. Default is 5432.DB_NAME Fixed database name. Default is "".DB_MAXCONN: Maximum database connection. default is 64.PGSSLMODE: SSL mode for postgres connection. Default is prefer.PGSSLROOTCERT: Path too ssl root cert. Required when using verify-ca mode.Load variables from file by setting compose secrets. Here are two examples:
db_user_FILE: Load database username from db_user secret.db_password_FILE: Load database user password from db_password secret.This is the mail configuration of the Odoo server.
SMTP_SERVER Adress of the SMTP server.SMTP_PORT Port of the SMTP server.SMTP_SSL Use ssl encryption. Default is False.SMTP_USER SMTP username.SMTP_PASSWORD SMTP user password.EMAIL_FROM Mail adress of the sender.Set mail parameters for the company.
MAIL_BOUNCE_ALIAS: Name of the bounce mail adress.MAIL_CATCHALL_ALIAS: Name of the reply-to mail adress.MAIL_CATCHALL_DOMAIN: Domain name of the reply-to mail address.MAIL_DEFAULT_FROM: From address for outgoing mails.MAIL_ALIAS_DOMAIN: Mail domain of the company.Setup mail configuration for the default database.
ODOO_MAIL_SMTP_HOST: If set Odoo sends mails to this host.ODOO_MAIL_SMTP_PORT: SMTP port. Default is 587.ODOO_MAIL_SMTP_ENCRYPTION: SMTP encryption type. Default is starttls.ODOO_MAIL_SMTP_FROM_FILTER: Send mails from this address only. Default is "".ODOO_MAIL_IMAP_HOST: If set Odoo fetches mails from this host.ODOO_MAIL_IMAP_PORT: IMAP port. Default is 993.ODOO_MAIL_IMAP_SSL: Enable IMAP SSL. Default is True.ODOO_MAIL_USERNAME: Username of the Odoo mailbox.ODOO_MAIL_PASSWORD: Password of the Odoo mailbox.The configuration will be applied to the DB_NAME database.
The image can clone git repositories.
GIT_AUTHOR_NAME: Set user name global git config.GIT_AUTHOR_EMAIL: Set user email global git config.GIT_SSH_PUBLIC_KEY: Public key for SSH connection.GIT_SSH_PRIVATE_KEY: Base64 encoded private key for SSH connection: cat ~/.ssh/id_ed2551 | base64 -w0SSH_ID_ALGORITHM: Filename and algorithm of the SSH key file. Default is id_ed25519GITHUB_USERNAME GitHub username for https git clone and archive download.GITHUB_PAT: GitHub access token for https git clone and archive download.GITLAB_URL: Url of GitLab instance. Default is https://gitlab.com.GITLAB_USERNAME: GitLab Username for https git clone.GITLAB_PAT: GitLab access token for https git clone and archive download.FORGEJO_URL: Url of Forgejo instance. Default is https://codeberg.org.FORGEJO_USERNAME: Forgejo Username for https git clone.FORGEJO_PAT: Forgejo access token for https git clone and archive download.ADDONS_GIT_REPOS: Comma or line-break seperated list of git clone urls appended with # and branch name.ODOO_ENTERPRISE_REF: Commit ref of Odoo Enterprise repo. Default is based on the image revision date.ODOO_ENTERPRISE_URL: Url of the Odoo Enterprise repo. Default is https://github.com/odoo/enterprise. Use a git url like git@github.com:odoo/enterprise to download with SSH.You can use https and git urls for ADDONS_GIT_REPOS:
bashADDONS_GIT_REPOS=git@github.com:OCA/server-tools#18.0,git@github.com:Mint-System/Odoo-Apps-Server-Tools ADDONS_GIT_REPOS=https://github.com/OCA/server-tools#18.0,https://github.com/Mint-System/Odoo-Apps-Server-Tools
If you use a git url, make sure a valid SSH private/public key is defined. Branch name fallback is the Odoo version.
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. Default is:
/mnt/extra-addons Default location for custom modules./var/lib/odoo/enterprise Reserved location for Odoo Enterprise modules./var/lib/odoo/git Reserved location for git repos.TEST_ADDONS_DIR Variable location for module testing./opt/odoo/addons Reserved location for Odoo community modules.ODOO_ENTERPRISE_PATH Odoo Enterprise is cloned to this folder. Default is /var/lib/odoo/enterprise.Set these environment variables for the database init:
ODOO_INIT_LOGIN Username of the admin user. Default is admin.ODOO_INIT_PASSWORD Password of the admin user. Default is admin.ODOO_INIT_LANG Language used for database init. Default is en_US.ODOO_INIT_ADDONS Provide comma separated list of modules for database init. Default is web.WITHOUT_DEMO If enabled Odoo inits the database with demo data. Default is True.The Odoo server can be configured using these env vars:
RUNNING_ENV Provide an environment name. Can be accessed with config.get("environment").PYTHON_INSTALL Comma or line-break seperated list of python packages.SERVER_WIDE_MODULES Comma separated list of modules to load with server. The variable will be prefixed with base,web.SESSION_DB_URI Connection string for storing session data in database.PROXY_MODE Enable server proxy mode. Default is True.LOG_LEVEL Set the logging level. Default is info.LOG_DB When enabled the database log is shown in the Odoo log. Default is False.LOG_HANDLER Define the log handler. Default is [':INFO'].LOGFILE Set the logging level. Default is None.The Odoo database manager is disabled by default.
LIST_DB Enable the database manager. Default is False.ADMIN_PASSWD Master password for database manager. Default is odoo.DB_FILTER Set filter for database name. Default is .*.Odoo is executed as a multi-threaded Python process.
MAX_CRON_THREADS Maximum count of cron threads. Default is 2.WORKERS Define how many workers should be spawned. Default is 0.LIMIT_REQUEST Maximum number of requests per worker. Default is 65536.LIMIT_TIME_CPU Maximum cpu time per request. Default is 60.LIMIT_TIME_REAL Maximum real time per request. Default is 120.LIMIT_MEMORY_HARD Hard memory limit for the Odoo process. Default is 2560 * 1024 * 1024.LIMIT_MEMORY_SOFT Soft memory limit for the Odoo process. Default is 2048 * 1024 * 1024.LIMIT_MEMORY_HARD_GEVENT Set hard memory limit for the gevent process. Default is False.LIMIT_MEMORY_SOFT_GEVENT Set soft memory limit for the gevent process. Default is False.To calculate the amount of workers multply the amount of cpu cores by 2. To get the cpu core count run nproc.
With the module_change_auto_install module you can disable the auto installation of specific modules.
MODULE_AUTO_INSTALL_DISABLED Comma separated list of modules that should be auto installed. Requires module_change_auto_install in SERVER_WIDE_MODULES.Updating translations and the module list can be automated.
AUTO_UPDATE_TRANSLATIONS If enabled, translatiosn will be updated when the container starts. Default is False.AUTO_UPDATE_MODULES_LIST If enabled, the modules list will be updated when the container starts. Default is False.With this image you can also run module tests.
TEST_ADDONS_DIR: Provide the directory with the modules that should be tests.TEST_INCLUDE Comma separated list of modules that should be test exlusively.TEST_EXCLUDE: Comma separated list of modules that should not be tested.If you have additional config for Odoo use the vars:
ADDITIONAL_ODOO_RC: Added to the options section of the odoo.conf.IR_CONFIG_PARAMETER: Added to the ir.config_parameter section of the odoo.conf.This image tries to stay compatible with other images such as https://github.com/acsone/odoo-bedrock or https://github.com/Tecnativa/doodba.
Compatibility with other images is mainly achieved by using the same environments variables and offering the same functionality.
The /etc/odoo/odoo.conf is templated during container start. To output the content run docker exec odoo config.
If you mount a requirements.txt to /var/lib/odoo/requirements.txt the install-python-packages script will run uv pip install -r requirements.txt in the directory.
When mounting your pyproject.toml to /var/lib/odoo/pyproject.toml the sync-python-project script will run uv sync --active in the directory.
The image includes https://github.com/acsone/git-aggregator. It allows to clone and merge addon repos from different origins and branches.
When mounting the repos.yml to /var/lib/odoo/git/repos.yml the aggregate-git-repos script will run the gitaggregate command in the directory.
The image includes the https://nginx.org/. If the container is started with odoo-nginx in addition to the Odoo process a nginx reverese proxy is started. The nginx config file is loaded from /etc/nginx/nginx.conf and the process is listening on port 8080.
Make sure to set WORKERS to 1 or more, otherwise the real-time connection of Odoo will not work. Having one or more workers will start the gevent listener on port 8072.
See Odoo Build > Build and publish container image for details.
The most important image paths are:
/etc/odoo Contains the odoo.conf and odoo.conf.template files/home/odoo Home directory of the container user/mnt/extra-addons Nested module folders are loaded from this path by default/mnt/test-addons Default mount path for modules to test/opt/odoo Location for Odo source/opt/odoo/addons Contains the Odoo community edition modules/opt/odoo/venv Virtual environment for Python runtime and packages/var/lib/odoo Odoo data folder for persistence/var/lib/odoo/enterprise Odoo Enterprise modules are downloaded to this folder/var/lib/odoo/filestore For every database Odoo creates a filestore/var/lib/odoo/git The cloned module repos are stored here/var/lib/odoo/sessions Location where werkzeug stores session informationUnder the hood the image uses several scripts to manage Odoo. Make yourself familiar with these scripts:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务
以下是 mintsystem/odoo 相关的常用 Docker 镜像,适用于 不同场景 等不同场景: