From 65ecd5309d4cb9f0aef8a2166913d26d58a0b4ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Tue, 15 Aug 2023 01:37:05 -0300 Subject: [PATCH] multi-stage prod build: lighter and faster --- src/odoo/Dockerfile.jinja | 12 +++++++++--- src/odoo/odoo-spec.yaml.jinja | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/odoo/Dockerfile.jinja b/src/odoo/Dockerfile.jinja index ac84afa..5d8d313 100644 --- a/src/odoo/Dockerfile.jinja +++ b/src/odoo/Dockerfile.jinja @@ -1,3 +1,11 @@ +FROM ghcr.io/akretion/odoo-docker-builder:{{ odoo_version }}-latest as odoo-builder +COPY odoo-spec.yaml /odoo/odoo-spec.yaml +COPY odoo-frozen.yaml /odoo/odoo-frozen.yaml +WORKDIR /odoo +ENV BUILD_RESTRICT_LANG=fr.po +RUN --mount=type=cache,target=/root/.cache /install/build-odoo + + FROM ghcr.io/akretion/odoo-docker:{{ odoo_version }}-latest as base # syntax = docker/dockerfile:1.4 @@ -5,9 +13,7 @@ FROM ghcr.io/akretion/odoo-docker:{{ odoo_version }}-latest as base FROM base as prod # Build and install odoo -COPY odoo-spec.yaml /odoo/odoo-spec.yaml -ENV BUILD_RESTRICT_LANG=fr.po -RUN --mount=type=cache,target=/root/.cache /install/build-odoo +COPY --from=odoo-builder /odoo/src /odoo/src RUN --mount=type=cache,target=/root/.cache pip install -e /odoo/src # Build external source diff --git a/src/odoo/odoo-spec.yaml.jinja b/src/odoo/odoo-spec.yaml.jinja index 15ac283..6d9144d 100644 --- a/src/odoo/odoo-spec.yaml.jinja +++ b/src/odoo/odoo-spec.yaml.jinja @@ -1,4 +1,5 @@ odoo: + fetch_all: False # modules: [] # do not forget to define the complete list # of odoo core modules