📜  odoo docker addons path (1)

📅  最后修改于: 2023-12-03 14:44:52.211000             🧑  作者: Mango

Odoo Docker Addons Path

If you are working with Odoo using Docker, you may need to add custom addons to your Odoo instance. In this case, you need to know where to put your addons so they can be found by Odoo.

Default Addons Path

The default addons path for Odoo running inside a Docker container is /mnt/extra-addons. This is where Odoo will look for additional addons.

You can mount a local directory as the extra-addons directory inside the container. Here is an example command to run an Odoo container with custom addons:

docker run -v /path/to/custom-addons:/mnt/extra-addons -p 8069:8069 --name odoo --link db:db -t odoo

In this command, the /path/to/custom-addons directory is mounted as the extra-addons directory inside the container.

Adding Multiple Paths

If you want to add multiple addons paths, you can do it by setting the --addons-path command-line option.

docker run -v /path/to/custom-addons:/mnt/extra-addons -e ADDONS_PATH=/mnt/extra-addons:/mnt/other-addons -p 8069:8069 --name odoo --link db:db -t odoo

In this command, we added the ADDONS_PATH environment variable and set it to a colon-separated list of addons paths. In this case, we added both /mnt/extra-addons and /mnt/other-addons.

Conclusion

Adding custom addons to your Odoo Docker instance is easy, and you can do it by mounting a local directory as the extra-addons directory or using the ADDONS_PATH environment variable to set multiple addons paths.