Skip to content

rogeliovc/odoo18-enterprise-docker-stack

Repository files navigation

Odoo 18 Enterprise - Docker Development Environment

Odoo Docker PostgreSQL License

A lightweight, robust, and isolated Docker environment tailored for Odoo 18 development. This repository serves as a foundational template to quickly spin up a local instance of Odoo with PostgreSQL, optimized for developers who deploy to Odoo.sh or custom cloud infrastructures.

This template explicitly separates the infrastructure setup from your private business logic (custom modules). It uses SSH and Git best practices to ensure no sensitive data or proprietary code is ever exposed in this configuration repository.


Architecture & Directory Structure

Odoo's module loading logic is strict. This repository is structured to perfectly map your local development folders to the Docker container without causing permission loops or nested-module reading errors.

.
├── addons/                     # Mapped to /mnt/extra-addons in the container
│   ├── custom_modules/         # Put your custom Odoo apps here (e.g., my_sales_module)
│   └── enterprise/             # Clone the Odoo Enterprise repo here (From odoo admin)
├── config/
│   └── odoo.conf               # Master configuration file
├── docker-compose.yml          # Container orchestration
└── .gitignore                  # Security shield

Important

Security Note: The .gitignore is heavily configured to ignore the contents of addons/. This repo manages the environment, while your custom modules inside addons/ should be managed by their own Git repositories or submodules in odoo.sh or something similar.


Quick Start Guide

1. Clone the Environment

git clone [https://github.com/rogeliovc/odoo18-enterprise-docker-stack.git](https://github.com/rogeliovc/odoo18-enterprise-docker-stack.git) my-local-odoo
cd my-local-odoo

2. Add Your Custom Modules

Clone your private company repositories or create new modules inside the addons/custom_modules directory. Ensure you have your SSH keys configured locally to fetch private repos.

cd addons/custom_modules
git clone git@github.com:your-company/private-modules.git .

3. Clone or add the Enterprise code to enterprise/

cd enterprise
# put or execute git clone

4. Spin Up the Containers

Return to the root directory and start the environment in detached mode:

docker compose up -d

Access Odoo at: http://localhost:8069


Technical Deep Dive & Troubleshooting

The Websocket 8072 Error (KeyError: 'socket')

When running Odoo locally via Docker without a Reverse Proxy (like Nginx), you might encounter terminal spam and connection drops regarding port 8072. Odoo tries to route live chat and notifications through a dedicated websocket port when multiprocessing is enabled.

The Fix included in this repo: Inside config/odoo.conf, we explicitly set workers = 0. This forces Odoo into Multithreading mode (instead of multiprocessing). Odoo will now smoothly handle both standard HTTP traffic and Websocket requests through the single 8069 port, eliminating the error and making the local server highly stable for debugging.

Git Workflow: Pushing to Odoo.sh

When working with multiple developers, you might have empty submodule folders locally if you lack read permissions for certain third-party apps.

Crucial Rule: Never use git add . in your root custom modules folder if you have uninitialized submodules. Doing so will push empty folders to Odoo.sh, breaking the deployment for your team.

Instead, use Surgical Commits:

# Only stage the specific module you created/modified
git add addons/custom_modules/my_new_module/
git commit -m "[ADD] my_new_module: Initial structure"
git push origin <your-odoo-sh-branch>  # e.g., 18.0-PU or 18.0-feature

The Developer "Ritual"

Depending on the files you modify, Odoo requires different update strategies inside this Docker environment:

Python (.py) or Manifest (__manifest__.py) changes:

  1. Python runs in RAM. You must restart the container: docker compose restart web
  2. Go to Odoo UI -> Apps -> Find your module -> Click Upgrade.

XML (.xml) changes (Views, Menus, Actions):

  1. No Docker restart needed.
  2. Go to Odoo UI -> Apps -> Click Upgrade on your module.

Adding a completely NEW module folder:

  1. Ensure Developer Mode is active.
  2. Go to Apps -> Click Update Apps List in the top menu.
  3. Search for your module and click Install.

License

This template is open-source and available under the MIT License. Feel free to fork it, modify it, and use it to bootstrap your Odoo development journey.

About

Odoo 18 Dockerized development environment. Features strict directory isolation for private modules, multi-threading optimization (Workers=0), and seamless Odoo.sh CI/CD integration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors