erplibre/docker/README.md
Mathieu Benoit 42e10bcced [UPD] install : le venv d'outillage passe en Python 3.14.7
install_erplibre.sh bâtissait .venv.erplibre avec le python3 du système, quelle
que soit sa version : un 3.10 y donnait un venv que l'outillage ne sait pas
charger. Il délègue à install_venv.sh, qui obtient la version par mise, pyenv
ou la distribution, et rebâtit un venv hors service. Le PATCH ne borne que le
venv d'Odoo, dont le pyproject exige « >=3.12.10,<3.13 » : l'exiger ailleurs
écartait un Python de distribution d'un cran en retard — NixOS 25.11 livre
3.14.2 — et faisait compiler CPython pour rien. Le module NixOS déclare
désormais les DEUX Python, substitués depuis les fichiers de version.
Vérifié : 15 tests sur des venvs factices, conservés, rebâtis ou refusés selon
leur état, et un chemin sans pyvenv.cfg garde son contenu.

--- EN ---

install_erplibre.sh built .venv.erplibre with the system python3, whatever its
version: a 3.10 gave a venv the tooling cannot load. It delegates to
install_venv.sh, which obtains the version through mise, pyenv or the
distribution, and rebuilds a venv out of service. The PATCH bounds only Odoo's
venv, whose pyproject requires ">=3.12.10,<3.13": requiring it elsewhere turned
away a distribution Python one step behind — NixOS 25.11 ships 3.14.2 — and
compiled CPython for nothing. The NixOS module now declares BOTH Pythons,
substituted from the version files.
Checked: 15 tests on stub venvs, kept, rebuilt or refused by their state, and a
path without pyvenv.cfg keeps its content.

Assisted-by: Claude Opus 5
2026-09-24 13:56:57 -04:00

153 lines
3.3 KiB
Markdown

# ERPLibre - Docker
Those images are prepared to permit better portability and reproducibility of ERPLibre release.
Due the growing code of ERPLibre, it could also simplify development.
NOTE: Those Dockerfiles themselves are in heavy development for now. Incompatibilities between releases are normal until the interface is stabilized.
## Pre-requirements
- Basic knowledge with Docker, Linux and bash
- Latest Docker version
## Files representations
- Dockerfile.base: This Dockerfile represents the base Docker image layer reused by other child layers.
- Dockerfile.dev: This Dockerfile is specialized in development.
- Dockerfile.prod{pkg,src}: Dockerfile.prod.\* is a Docker image specialized for production systems. Dockerfile.prod.pkg reuses official Debian files from Odoo.com. Dockerfile.prod.src fetches the Odoo source code as the ERPLibre runtime.
## Getting started
Be sure to start daemon docker
```bash
systemctl start docker
```
### Building the docker images
```bash
cd docker
docker build -f Dockerfile.base -t technolibre/erplibre-base:12.0 .
docker build -f Dockerfile.prod.pkg -t technolibre/erplibre:12.0-pkg .
```
`.venv.erplibre` is built on the image's own Python, Odoo's, without mise or
pyenv. The build stops when that Python cannot parse `script/`, which happens
with a deprecated Odoo version.
### Running ERPLibre using Docker-Compose
Go at the root of this git project.
```bash
cd ERPLibre
docker compose -f docker-compose.yml up -d
```
### Diagnostic Docker-Compose
Show docker-compose information
```bash
docker compose ps
docker compose logs IMAGE_NAME
```
Show docker information
```bash
docker ps -a
docker volume ls
docker inspect DOCKER_NAME
```
Connect to a running docker
```bash
docker exec -ti DOCKER_NAME bash
docker exec -u root -ti DOCKER_NAME bash
```
Commands for debugging
```bash
docker run -p 8069:8069 --entrypoint bash -ti DOCKER_NAME
docker exec -ti DOCKER_NAME bash
docker exec -u root -ti DOCKER_NAME bash
docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_USER=odoo -e POSTGRES_DB=postgres postgre
export
db_host = "host.docker.internal"
docker stats erplibre_ERPLibre_1
```
### Cleaning
Delete all system
```bash
docker system prune -a
```
Delete docker image
```bash
docker image prune
docker rmi $(docker images -q)
```
Delete volumes
```bash
docker compose rm -v
```
Delete containers
```bash
docker rm $(docker ps -a | grep -v IMAGE | awk '{print $1}')
```
Delete volume
```bash
docker volume prune
```
# Change docker directory
You can change the docker directory by editing file `/etc/docker/daemon.json`
```json
{
"data-root": "/home/docker"
}
```
And restart docker service. You can delete or move all older locations of docker.
Or
Add `--data-root /second_drive/docker` like example following into file `/lib/systemd/system/docker.service` :
```
ExecStart=/usr/bin/dockerd --data-root /second_drive/docker -H fd:// --containerd=/run/containerd/containerd.sock
```
# Update docker
When building your docker with script
> make docker_build_odoo_18
List your docker version
> docker images
You need to push your docker image and update your tag, like 1.0.1:
> docker push technolibre/erplibre:VERSION
# Diagnostic
When getting and error about missing module, or after an upgrade, you need to update config file.
> make docker_exec_erplibre_gen_config