Skip to content

Docker Compose

DantePereyra edited this page Feb 23, 2026 · 11 revisions

Docker Compose

Install Docker Compose

First, you have to install docker-compose, this will install Docker.

sudo apt install docker-compose

Create the Main Folder

mkdir dockerdoo
cd dockerdoo
mkdir erp
cd erp

Clone Production or Test Instance

We use this version, as it's configured to our needs and creates an Odoo image from scratch (you'll see the difference later).

git clone -b main https://github.com/iterativo-git/dockerdoo erp_prod(_test)

_prod or _test, depending on the environment. This is a general configuration, sometimes will be other names, depending on the Odoo's usage and client needs

Edit the .env File

Before running Docker Compose, you should review the .env file, which sets most variables used in this project.

nano .env

Update the following variables:

ODOO_VERSION=$version
PSQL_VERSION=14 #(Unless needed, this will be the PSQL version used, as the OS image used is slim-bookworm that supports only to 15)
WORKERS=4
ADMIN_PASSWORD=$new_password
DBFILTER=^erp_$instance.*$

⚠️ The next variable should only be updated when Nginx:

PROXY_MODE=True

Recommended Ports

nano docker-compose.yml
Environment HTTP Gevent PostgreSQL
Production 8169 8172 54321
Test 8269 8272 54322
odoo:
    ports:
        - 8169:8069
        - 8172:8072
db:
    ports:
        - 54321:5432

Adapt to Docker Version

Before continue, it's needed some adaptations on .env that depends on which version

VERSION 18.0

When installing 18.0 version it's needed to add phonenumbers dependency. Go to line 147, before Odoo installation:

RUN pip3 install --prefix=/usr/local --no-cache-dir --upgrade --requirement http
     python-json-logger \
     wdb \
     redis \
++   phonenumbers \
     && apt-get autopurge -yqq \
     && rm -rf /var/lib/apt/lists/* /tmp/*

Build Docker Image and Start Container

⚠️ Before this, go to line 132 and put RUN pip3 install --upgrade setuptools. It prevents zope.event error

sudo docker-compose up -d

If you encounter dependency issues related to wheel, edit the Dockerfile and add the following at line 132:

RUN pip install --upgrade pip setuptools wheel

Then run the previous command again.

Check Installation

To check if it's running OK connect via ssh redirecting ports:

ssh -L ($your_port):localhost:8169/8269 $user@$$IP_or_VMName

Visit your server's $IP_or_VMName on port 8169 in a browser. If the database creation screen shows up, it worked.

Database Setup

  • Master password: as defined in .env
  • Database name: $instance
  • Email: admin
  • Password: $new_password

Create Custom Delegated Directory

Edit docker-compose.yml to indicate the new, more convenient location for working with the repositories:

nano docker-compose.yml

odoo:
     volumes:
      # Host paths (.ssh configuration)
      - ~/.ssh/:/opt/odoo/.ssh/:cached
      - ./custom:${ODOO_EXTRA_ADDONS}:delegated
      # Named volumes
      - odoo-data:${ODOO_DATA_DIR}
      - odoo-testlogs:${ODOO_LOGS_DIR}
      # - odoo-modules:${ODOO_EXTRA_ADDONS}

Clone Custom Modules

Gitaggregator will be used to clone repositories. To do this, first create a new virtual environment within the custom folder to use Gitaggregator.

cd ~/dockerdoo
python3 -m venv .venv-gitaggregator
source .venv-gitaggregator/bin/activate

Once created, install it:

pip install git-aggregator

Next, create a file called repos_(OCA/SLV).yaml on dockerdoo/erp/erp_prod(test)/custom with the following syntax:

./account-analytic:
    remotes:
        oca: https://github.com/OCA/account-analytic.git
    merges:
        - oca 17.0
./product_attribute:
    remotes:
        oca: https://github.com/OCA/product-attribute.git
    merges:
        - oca 17.0
        - oca refs/pull/105/head
        - oca refs/pull/106/head

The following command would be executed on custom/:

gitaggregate -c repos_OCA/SLV.yaml

If needed only specific repo use: `-d $repo/

Check that all repos where installed.

Usual installed repos from OCA

This is an example of a repos_OCA.yaml file that had all repos that we need and use:

./account-analytic:
    remotes:
        oca: https://github.com/OCA/account-analytic.git
    merges:
        - oca 18.0  

    fetch_all:
        - oca

./account-financial-reporting:
    remotes:
        oca: https://github.com/OCA/account-financial-reporting.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./account-financial-tools:
    remotes:
        oca: https://github.com/OCA/account-financial-tools.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./account-invoice-reporting:
    remotes:
        oca: https://github.com/OCA/account-invoice-reporting.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./account-invoicing:
    remotes:
        oca: https://github.com/OCA/account-invoicing.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./account-payment:
    remotes:
        oca: https://github.com/OCA/account-payment.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./account-reconcile:
    remotes:
        oca: https://github.com/OCA/account-reconcile.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./bank-payment:
    remotes:
        oca: https://github.com/OCA/bank-payment.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./bank-statement-import:
    remotes:
        oca: https://github.com/OCA/bank-statement-import.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./calendar:
    remotes:
        oca: https://github.com/OCA/calendar.git
    merges:
        - oca 18.0
    fetch_all:
        - oca

./community-data-files:
    remotes:
        oca: https://github.com/OCA/community-data-files.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./contract:
    remotes:
        oca: https://github.com/OCA/contract.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./crm:
    remotes:
        oca: https://github.com/OCA/crm.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./edi:
    remotes:
        oca: https://github.com/OCA/edi.git 
    merges:
        - oca 18.0
    fetch_all:
        - oca 18.0

./edi-framework:
    remotes:
        oca: https://github.com/OCA/edi-framework.git 
    merges:
        - oca 18.0
    fetch_all:
        - oca 18.0

./helpdesk:
    remotes:
        oca: https://github.com/OCA/helpdesk.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./hr:
    remotes:
        oca: https://github.com/OCA/hr.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./hr-attendance:
    remotes:
        oca: https://github.com/OCA/hr-attendance.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./hr-expense:
    remotes:
        oca: https://github.com/OCA/hr-expense.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./hr-holidays:
    remotes:
        oca: https://github.com/OCA/hr-holidays.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./l10n-spain:
    remotes:
        oca: https://github.com/OCA/l10n-spain.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./mis-builder:
    remotes:
        oca: https://github.com/OCA/mis-builder.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./payroll:
    remotes:
        oca: https://github.com/OCA/payroll.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./project:
    remotes:
        oca: https://github.com/OCA/project.git
    merges:
        - oca 18.0
    fetch_all:
        - oca

./project-reporting:
    remotes:
        oca: https://github.com/OCA/project-reporting.git
    merges:
        - oca 18.0  
    fetch_all:
        - oca

./report-engine:
    remotes:
        oca: https://github.com/OCA/reporting-engine.git
    merges:
        - oca 18.0
    fetch_all:
        - oca

./server-tools:
    remotes:
        oca: https://github.com/OCA/server-tools.git 
    merges:
        - oca 18.0
    fetch_all:
        - oca

./server-ux:
    remotes:
        oca: https://github.com/OCA/server-ux.git 
    merges:
        - oca 18.0
    fetch_all:
        - oca

./stock-logistics-workflow:
    remotes:
        oca: https://github.com/OCA/stock-logistics-workflow.git
    merges:
        - oca 18.0
    fetch_all:
        - oca

./web:
    remotes:
        oca:  https://github.com/OCA/web.git
    merges:
        - oca 18.0
    fetch_all:
        - oca

Final Steps

  • Configure languages in Odoo
  • Install required modules
  • Customize environment as needed

Clone this wiki locally