Use Docker to deploy Odoo development environment in Linux

  Since you have Docker, you don't have to worry about the environment anymore. It is convenient and quick to use Docker when publishing, but you need to use your own addons when developing. Docker can map your own Addons to the specified addons directory of Odoo in the container, so that you can develop Odoo Immediately it was easy. The mapping is very simple. When docker run, enable the ' -v ' command to specify the mapping directory, the specific format is the same as ' -p ', such as: -v host working directory: directory in the container.

  1. Start the Postgres container

sudo docker run -d -v / home / odoo / odoo-dev / docker_odoo / pgdata /: / usr / lib / postgresql / data -e POSTGRES_USER = odoo -e POSTGRES_PASSWORD = odoo --name db postgres: 9.4

  2. Dynamic Odoo

sudo docker run -v / home / odoo / odoo-dev / docker_odoo / my_addons /: / mnt / extra-addons -p 8069 : 8069 --name odoo --link db: db -t odoo --db-filter = ODOO . *

  In this way, you can write your own modules in the /home/odoo/odoo-dev/docker_odoo/my_addons/ directory of the local machine.

  Looking at the tutorial in hub.docker.com, it says that you can customize the Odoo configuration. The general method is the same as mapping the working directory. Use ' -v ' to map, but in practice, it is found that mapping the configuration and working directory at the same time does not work, so it is still directly specified. Inline odoo parameters to use custom configuration, such as the last '--db-filter=ODOO.*' in the above start Odoo command, which means that the data instance name only accepts the beginning of 'ODOO'.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325273238&siteId=291194637