-
Notifications
You must be signed in to change notification settings - Fork 0
Docker Compose
First, you have to install docker-compose, this will install Docker.
sudo apt install docker-composemkdir dockerdoo
cd dockerdoo
mkdir erp
cd erpWe 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
Before running Docker Compose, you should review the .env file, which sets most variables used in this project.
nano .envUpdate 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=Truenano docker-compose.yml| Environment | HTTP | Gevent | PostgreSQL |
|---|---|---|---|
| Production | 8169 | 8172 | 54321 |
| Test | 8269 | 8272 | 54322 |
odoo:
ports:
- 8169:8069
- 8172:8072
db:
ports:
- 54321:5432Before continue, it's needed some adaptations on .env that depends on which version
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/*
⚠️ Before this, go to line 132 and putRUN pip3 install --upgrade setuptools. It prevents zope.event error
sudo docker-compose up -dIf you encounter dependency issues related to wheel, edit the Dockerfile and add the following at line 132:
RUN pip install --upgrade pip setuptools wheelThen run the previous command again.
To check if it's running OK connect via ssh redirecting ports:
ssh -L ($your_port):localhost:8169/8269 $user@$$IP_or_VMNameVisit your server's $IP_or_VMName on port 8169 in a browser. If the database creation screen shows up, it worked.
-
Master password: as defined in
.env -
Database name:
$instance -
Email:
admin -
Password:
$new_password
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}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/activateOnce 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/headThe 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.
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- Configure languages in Odoo
- Install required modules
- Customize environment as needed