docker icon indicating copy to clipboard operation
docker copied to clipboard

Odoo different versions (docker) with different databases on Ubuntu 20.04 #532

Open mamtaRaiTech opened this issue 1 year ago • 1 comments

To set up separate Docker containers for Odoo versions 16, 17, and 18, and configure your development environment using PyCharm Community Edition or Visual Studio Code, follow these steps:

  1. Setting Up Separate Docker Containers for Each Odoo Version:

Create Separate Directories: For each Odoo version, create a separate directory to maintain isolation.

bash Copy code mkdir odoo16 odoo17 odoo18 Docker Compose Configuration: In each directory, create a docker-compose.yml file specifying the desired Odoo version and its dependencies. Here's an example for Odoo 16:

yaml Copy code version: '3' services: odoo: image: odoo:16.0 ports: - "8069:8069" volumes: - ./custom_addons:/mnt/extra-addons environment: - HOST=db - USER=odoo - PASSWORD=odoo db: image: postgres:13 environment: - POSTGRES_USER=odoo - POSTGRES_PASSWORD=odoo Repeat this process for Odoo 17 and 18, adjusting the image tag accordingly.

Start Containers: Navigate to each directory and start the containers:

bash Copy code cd odoo16 docker-compose up -d Repeat for odoo17 and odoo18.

  1. Configuring PyCharm Community Edition or Visual Studio Code:

PyCharm Community Edition:

Remote Development: Utilize the "Remote Repositories" feature to connect to your Docker containers.

Custom Addons: Mount your custom addons directory as a volume in the Docker container to enable real-time development.

Odoo Configuration (odoo.conf): Ensure the addons_path in your odoo.conf file includes the path to your custom addons.

Requirements (requirements.txt): Install necessary Python packages within the Docker container to match your development environment.

Visual Studio Code:

Remote Development: Use the "Remote - Containers" extension to develop inside your Docker containers.

Custom Addons: Similar to PyCharm, mount your custom addons directory to the container.

Odoo Configuration: Update the addons_path in odoo.conf to include your custom addons.

Requirements: Ensure all dependencies are installed within the container.

  1. Accessing Official Addons:

Official Odoo addons are available in the Odoo GitHub repository. You can clone the repository and include it in your addons_path for development purposes.

By following these steps, you can maintain separate environments for each Odoo version and configure your development tools accordingly.

For a detailed walkthrough on setting up Odoo 16 with PyCharm, you can refer to the following video:

mamtaRaiTech avatar Dec 18 '24 07:12 mamtaRaiTech

The way you outlined the process of installation in docker for multiple versions is much complex, the most simplified and intuitive one can be found on following official URL of odoo for all its versions: https://hub.docker.com/_/odoo

hunter0014 avatar Apr 28 '25 09:04 hunter0014