Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1.39 KB

how-to-add-dependency.md

File metadata and controls

42 lines (29 loc) · 1.39 KB

Adding dependencies

How to add a Python package

The Python dependencies for Odoo are already installed in the base container (camptocamp/odoo-project:11.0) used for this project. At times, you might need to add an additional dependency required solely for this project, here are the steps.

If the file odoo/requirements.txt exists, skip to number 3.

  1. Create the file odoo/requirements.txt
  2. Add the following lines in odoo/Dockerfile to instruct Docker to copy the requirements in the image and to install them with pip:
COPY ./requirements.txt ./
RUN pip install -r requirements.txt
  1. Add the Python package in odoo/requirements.txt
  2. Build again your Docker image: docker-compose build odoo

You can also add dev requirements which are used on your dev machine but never committed.

How to add a Debian package

Edit odoo/Dockerfile and add the following lines:

RUN set -x; \
        apt-get update \
        && apt-get install -y --no-install-recommends \
        <<name-of-the-package>> \
        && apt-get clean \
        && rm -rf /var/lib/apt/lists/*

If a similar command already exists. just add your package in your list. The cleanup at the end is important is it reduces the final size of the built image.

Once the package added, you have to build again your local Docker image using docker-compose build odoo