docker
docker copied to clipboard
Odoo different versions (docker) with different databases on Ubuntu 20.04 #532
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:
- 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.
- 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.
- 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: