Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM surnet/alpine-wkhtmltopdf:3.16.0-0.12.6-small as wkhtmltopdf
FROM alpine as build
# Initial setup of new root.
RUN apk update \
&& mkdir --parents \
/newroot/etc \
/newroot/bin \
/newroot/usr/bin \
&& cp -a --parents \
/bin/busybox \
/lib/ld-musl* \
/newroot/ \
&& /bin/busybox --install -s /newroot/bin/ \
&& /bin/busybox --install -s /newroot/usr/bin/ \
&& echo 'root:x:0:0:::' > /newroot/etc/passwd \
&& echo 'root:x:0:' > /newroot/etc/group
# Add depedencies
RUN apk add --no-cache \
file \
freetype-dev \
g++ \
gcc \
git \
jpeg-dev \
libev-dev \
libffi-dev \
libx11-dev \
libxrender-dev \
fontconfig-dev \
make \
musl-dev \
openldap-dev \
postgresql-dev \
py3-pip \
python3 \
python3-dev \
zlib-dev
# Add Odoo.
RUN git clone -b 16.0 --depth 1 https://github.com/OCA/OCB.git /newroot/opt/odoo/odoo \
&& rm -rf /newroot/opt/odoo/odoo/.git \
&& find /newroot/opt/odoo/odoo/addons/*/i18n/ /newroot/opt/odoo/odoo/odoo/addons/base/i18n/ -type f -not -name 'fr.po' -delete
## Add Git known hosts.
COPY ./ssh_known_git_hosts /root/.ssh/known_hosts
## Install Odoo OCA and Le Filament default dependencies.
RUN mkdir -p \
/tmp/oca-repos/ \
/newroot/opt/odoo/additional_addons \
/newroot/opt/odoo/private_addons \
&& git clone -b 16.0 --depth 1 \
https://github.com/OCA/account-financial-tools.git \
/tmp/oca-repos/account-financial-tools \
# && mv /tmp/oca-repos/account-financial-tools/account_lock_date_update \ # https://github.com/OCA/account-financial-tools/pull/1526
&& mv /tmp/oca-repos/account-financial-tools/account_move_name_sequence \
# /tmp/oca-repos/account-financial-tools/account_reconcile_show_boolean \
/tmp/oca-repos/account-financial-tools/account_usability \
/newroot/opt/odoo/additional_addons/ \
# && git clone -b 16.0 --depth 1 \
# https://github.com/OCA/account-invoicing.git \
# /tmp/oca-repos/account-invoicing \
# && mv /tmp/oca-repos/account-invoicing/sale_timesheet_invoice_description \
# /newroot/opt/odoo/additional_addons/ \
# Until migrated to OCA (https://github.com/OCA/account-reconcile/pull/500)
&& git clone -b 16.0-add-account_reconcile_oca --depth 1 \
https://github.com/tegin/account-reconcile.git \
/tmp/oca-repos/account-reconcile \
&& mv /tmp/oca-repos/account-reconcile/account_reconcile_oca \
/newroot/opt/odoo/additional_addons/ \
# && git clone -b 16.0 --depth 1 \
# https://github.com/OCA/account-reconcile.git \
# /tmp/oca-repos/account-reconcile \
# Until migrated to OCA (https://github.com/OCA/bank-statement-import/pull/535)
&& git clone -b 16.0-mig-account_statement_import --depth 1 \
https://github.com/sonhd91/bank-statement-import.git \
/tmp/oca-repos/bank-statement-import \
&& mv /tmp/oca-repos/bank-statement-import/account_statement_import_base \
/tmp/oca-repos/bank-statement-import/account_statement_import_file \
/newroot/opt/odoo/additional_addons/ \
# && git clone -b 16.0 --depth 1 \
# https://github.com/OCA/bank-statement-import.git \
# /tmp/oca-repos/bank-statement-import \
# && mv /tmp/oca-repos/bank-statement-import/account_statement_import_base \
# /tmp/oca-repos/bank-statement-import/account_statement_import_file \
# /tmp/oca-repos/bank-statement-import/account_statement_import_ofx \
# /newroot/opt/odoo/additional_addons/ \
# && git clone -b 16.0 --depth 1 \
# https://github.com/OCA/crm.git \
# /tmp/oca-repos/crm \
# && mv /tmp/oca-repos/crm/crm_stage_probability \
# /newroot/opt/odoo/additional_addons/ \
&& git clone -b 16.0 --depth 1 \
https://github.com/OCA/l10n-france.git \
/tmp/oca-repos/l10n-france \
&& mv /tmp/oca-repos/l10n-france/l10n_fr_siret \
/tmp/oca-repos/l10n-france/l10n_fr_siret_lookup \
&& git clone -b 16.0 --depth 1 \
https://github.com/OCA/partner-contact.git \
/tmp/oca-repos/partner-contact \
&& mv /tmp/oca-repos/partner-contact/partner_disable_gravatar \
/tmp/oca-repos/partner-contact/partner_firstname \
/newroot/opt/odoo/additional_addons/ \
&& git clone -b 16.0 --depth 1 \
https://github.com/OCA/project.git \
/tmp/oca-repos/project \
&& mv /tmp/oca-repos/project/project_task_default_stage \
/tmp/oca-repos/project/project_template \
/newroot/opt/odoo/additional_addons/ \
# && git clone -b 16.0 --depth 1 \
# https://github.com/OCA/server-auth.git \
# /tmp/oca-repos/server-auth \
# && mv /tmp/oca-repos/server-auth/password_security \
# /newroot/opt/odoo/additional_addons/ \
# && git clone -b 16.0 --depth 1 \
# https://github.com/OCA/server-brand.git \
# /tmp/oca-repos/server-brand \
# && mv /tmp/oca-repos/server-brand/disable_odoo_online \
# /tmp/oca-repos/server-brand/remove_odoo_enterprise \
# /newroot/opt/odoo/additional_addons/ \
# Until migrated to OCA (https://github.com/OCA/server-brand/pulls)
&& git clone -b 16.0 --depth 1 \
https://github.com/lefilament/server-brand.git \
/tmp/oca-repos/server-brand \
&& mv /tmp/oca-repos/server-brand/disable_odoo_online \
/tmp/oca-repos/server-brand/portal_odoo_debranding \
/tmp/oca-repos/server-brand/remove_odoo_enterprise \
&& git clone -b 16.0 --depth 1 \
https://github.com/OCA/server-tools.git \
/tmp/oca-repos/server-tools \
&& mv /tmp/oca-repos/server-tools/base_view_inheritance_extension \
/tmp/oca-repos/server-tools/module_change_auto_install \
/newroot/opt/odoo/additional_addons/ \
&& git clone -b 16.0 --depth 1 \
https://github.com/OCA/server-ux.git \
/tmp/oca-repos/server-ux \
&& mv /tmp/oca-repos/server-ux/server_action_mass_edit \
/newroot/opt/odoo/additional_addons/ \
&& git clone -b 16.0 --depth 1 \
https://github.com/OCA/social.git \
/tmp/oca-repos/social \
&& mv /tmp/oca-repos/social/mail_debrand \
# /tmp/oca-repos/social/mail_tracking \ # https://github.com/OCA/social/pull/1029
/newroot/opt/odoo/additional_addons/ \
&& git clone -b 16.0 --depth 1 \
https://github.com/OCA/web.git \
/tmp/oca-repos/web \
&& mv /tmp/oca-repos/web/web_environment_ribbon \
# /tmp/oca-repos/web/web_responsive \
# /tmp/oca-repos/web/web_no_bubble \
/tmp/oca-repos/web/web_refresher \
/tmp/oca-repos/web/web_theme_classic \
/newroot/opt/odoo/additional_addons/ \
&& rm -rf /tmp/oca-repos/ \
&& find /newroot/opt/odoo/additional_addons/*/i18n/ -type f -not -name 'fr.po' -delete \
&& git clone -b 16.0 --depth 1 \
https://sources.le-filament.com/lefilament/remove_login_links.git \
/newroot/opt/odoo/private_addons/remove_login_links \
&& git clone -b 16.0 --depth 1 \
https://sources.le-filament.com/lefilament/lefilament_release_agent.git \
/newroot/opt/odoo/private_addons/lefilament_release_agent
# Fix a ldap library bug.
RUN echo -n "INPUT ( libldap.so )" > /usr/lib/libldap_r.so
# Install Python requirements.
RUN pip install --requirement /newroot/opt/odoo/odoo/requirements.txt \
# astor required by base_view_inheritance_extension
# openupgradelib required for OCA module migration from one version to another
# phonenumbers required by phone_validation
# python-stdnum>=1.18 required by l10n_fr_siret and l10n_fr_siret_lookup
# PyYAML required by custom scripts for adding modules (https://sources.le-filament.com/lefilament/ansible-roles/docker_odoo/-/tree/master/templates)
# zxcvbn required by password_security
pip install astor openupgradelib phonenumbers python-stdnum>=1.18 PyYAML zxcvbn
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# Only copy libraries of needed binaries to new root.
RUN ls \
/lib/libz.so* \
/usr/bin/python3* \
/usr/lib/libexpat.so* \
/usr/lib/libfontconfig.so* \
/usr/lib/libfreetype.so* \
/usr/lib/libjpeg.so* \
/usr/lib/libpq.so* \
/usr/lib/libpython3.so* \
/usr/lib/python3.10/lib-dynload/*.so \
/usr/lib/python3.10/site-packages/*.so \
/usr/lib/libX11.so* \
/usr/lib/libXrender.so* \
> to_copy \
&& xargs -a to_copy -I R ldd R \
| tr -s '[:blank:]' '\n' \
| grep '^/' \
| sed 's/://' \
| sort -u \
| xargs cp -aL --parents -t /newroot/ \
&& xargs -a to_copy cp -a --parents -t /newroot/
# Copy Python libraries.
RUN cp -a --parents \
/usr/lib/python3.10/ \
/newroot
COPY --from=wkhtmltopdf /bin/wkhtmltopdf /newroot/bin/wkhtmltopdf
COPY ./entrypoint-scratch.sh /newroot/entrypoint.sh
# Add odoo user.
RUN echo 'odoo:x:1:1:::' >> /newroot/etc/passwd \
&& echo 'odoo:x:1:' >> /newroot/etc/group \
&& chown -R 1:1 /newroot/opt/odoo/ \
&& chmod 555 /newroot/entrypoint.sh \
&& mkdir /newroot/tmp \
&& chmod 1777 /newroot/tmp
# Final image.
FROM scratch
COPY --from=build /newroot /
# Mount /opt/odoo/data to allow restoring filestore.
VOLUME ["/opt/odoo/data/"]
# Expose Odoo services.
EXPOSE 8069
# Set default user when running the container.
USER odoo
# Start
ENTRYPOINT ["/entrypoint.sh"]
CMD ["odoo"]
# Metadata
LABEL org.label-schema.schema-version="16.0" \
org.label-schema.vendor=LeFilament \
org.label-schema.license=Apache-2.0 \
org.label-schema.vcs-url="https://sources.le-filament.com/lefilament/odoo_docker"