Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

save the planet 2/2: multi-stages prod build: lighter and faster #92

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/odoo/Dockerfile.jinja
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
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

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
Expand Down
1 change: 1 addition & 0 deletions src/odoo/odoo-spec.yaml.jinja
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
odoo:
fetch_all: False
# modules: []
# do not forget to define the complete list
# of odoo core modules
Expand Down