|
@@ -1,82 +1,121 @@
|
1
|
|
-FROM debian:buster
|
2
|
|
-MAINTAINER Odoo S.A. <info@odoo.com>
|
|
1
|
+FROM python:3.9-slim-buster
|
|
2
|
+MAINTAINER CLI <https://cli.coop>
|
3
|
3
|
|
4
|
|
-SHELL ["/bin/bash", "-xo", "pipefail", "-c"]
|
|
4
|
+ENV APT_DEPS='build-essential libldap2-dev libpq-dev libsasl2-dev' \
|
|
5
|
+ LANG=C.UTF-8 \
|
|
6
|
+ LC_ALL=C.UTF-8 \
|
|
7
|
+ PGDATABASE=odoo
|
5
|
8
|
|
6
|
|
-# Generate locale C.UTF-8 for postgres and general locale data
|
7
|
|
-ENV LANG C.UTF-8
|
|
9
|
+RUN set -x; \
|
|
10
|
+ apt-get update &&\
|
|
11
|
+ apt-get install -y --no-install-recommends \
|
|
12
|
+ curl \
|
|
13
|
+ git \
|
|
14
|
+ gnupg \
|
|
15
|
+ npm \
|
|
16
|
+ openssh-client &&\
|
|
17
|
+ echo 'deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main' >> /etc/apt/sources.list.d/postgresql.list &&\
|
|
18
|
+ curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - &&\
|
|
19
|
+ curl -o wkhtmltox.deb -SL https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_arm64.deb &&\
|
|
20
|
+ echo '43d0db99ab0e6b5f60b465a49c764c50d6b31337 wkhtmltox.deb' | sha1sum -c - &&\
|
|
21
|
+ apt-get update &&\
|
|
22
|
+ apt-get install -y --no-install-recommends ./wkhtmltox.deb &&\
|
|
23
|
+ apt-get install -y --no-install-recommends postgresql-client &&\
|
|
24
|
+ apt-get install -y --no-install-recommends ${APT_DEPS} &&\
|
|
25
|
+ pip3 install -r https://raw.githubusercontent.com/OCA/OCB/14.0/requirements.txt &&\
|
|
26
|
+ pip3 install phonenumbers simplejson gevent==20.12.1 PyYAML zxcvbn &&\
|
|
27
|
+ apt-get -y purge ${APT_DEPS} &&\
|
|
28
|
+ apt-get -y autoremove &&\
|
|
29
|
+ rm -rf /var/lib/apt/lists/* wkhtmltox.deb
|
8
|
30
|
|
9
|
|
-# Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf
|
10
|
|
-RUN apt-get update && \
|
11
|
|
- apt-get install -y --no-install-recommends \
|
12
|
|
- wget \
|
13
|
|
- ca-certificates \
|
14
|
|
- curl \
|
15
|
|
- dirmngr \
|
16
|
|
- fonts-noto-cjk \
|
17
|
|
- gnupg \
|
18
|
|
- libssl-dev \
|
19
|
|
- node-less \
|
20
|
|
- npm \
|
21
|
|
- python3-num2words \
|
22
|
|
- python3-pdfminer \
|
23
|
|
- python3-pip \
|
24
|
|
- python3-phonenumbers \
|
25
|
|
- python3-pyldap \
|
26
|
|
- python3-qrcode \
|
27
|
|
- python3-renderpm \
|
28
|
|
- python3-setuptools \
|
29
|
|
- python3-slugify \
|
30
|
|
- python3-vobject \
|
31
|
|
- python3-watchdog \
|
32
|
|
- python3-xlrd \
|
33
|
|
- python3-xlwt \
|
34
|
|
- xz-utils \
|
35
|
|
- && curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_arm64.deb \
|
36
|
|
- && echo '43d0db99ab0e6b5f60b465a49c764c50d6b31337 wkhtmltox.deb' | sha1sum -c - \
|
37
|
|
- && apt-get autoclean -y \
|
38
|
|
- && apt-get upgrade -y \
|
39
|
|
- && apt-get install -y --no-install-recommends ./wkhtmltox.deb \
|
40
|
|
- && rm -rf /var/lib/apt/lists/* wkhtmltox.deb
|
|
31
|
+# Add Git Known Hosts
|
|
32
|
+#COPY ./ssh_known_git_hosts /root/.ssh/known_hosts
|
41
|
33
|
|
42
|
|
-RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list' \
|
43
|
|
- && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
|
44
|
|
- && apt-get update \
|
45
|
|
- && apt-get install --no-install-recommends -y postgresql-client
|
|
34
|
+# Install Odoo and remove not French translations and .git directory to limit amount of data used by container
|
|
35
|
+RUN set -x; \
|
|
36
|
+ useradd -l --create-home --home-dir /opt/odoo --no-log-init odoo &&\
|
|
37
|
+ /bin/bash -c "mkdir -p /opt/odoo/{etc,odoo,additional_addons,private_addons,data,private}" &&\
|
|
38
|
+ git clone -b 14.0 --depth 1 https://github.com/OCA/OCB.git /opt/odoo/odoo &&\
|
|
39
|
+ rm -rf /opt/odoo/odoo/.git &&\
|
|
40
|
+ chown -R odoo:odoo /opt/odoo
|
46
|
41
|
|
47
|
|
-# Install rtlcss (on Debian buster)
|
48
|
|
-RUN npm install -g rtlcss
|
49
|
|
-
|
50
|
|
-# Install Odoo
|
51
|
|
-ENV ODOO_VERSION 14.0
|
52
|
|
-ARG ODOO_RELEASE=20211029
|
53
|
|
-ARG ODOO_SHA=9b1b93782b939f6246f3e230c655d68caff449d2
|
54
|
|
-RUN curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \
|
55
|
|
- && echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \
|
56
|
|
- && apt-get update \
|
57
|
|
- && apt-get -y install --no-install-recommends ./odoo.deb \
|
58
|
|
- && rm -rf /var/lib/apt/lists/* odoo.deb
|
|
42
|
+# Install Odoo OCA default dependencies
|
|
43
|
+RUN set -x; \
|
|
44
|
+ mkdir -p /tmp/oca-repos/ &&\
|
|
45
|
+ git clone -b 14.0 --depth 1 https://github.com/OCA/account-financial-reporting.git /tmp/oca-repos/account-financial-reporting &&\
|
|
46
|
+ mv /tmp/oca-repos/account-financial-reporting/account_tax_balance /opt/odoo/additional_addons/ &&\
|
|
47
|
+ git clone -b 14.0 --depth 1 https://github.com/OCA/account-financial-tools.git /tmp/oca-repos/account-financial-tools &&\
|
|
48
|
+ mv /tmp/oca-repos/account-financial-tools/account_lock_date_update \
|
|
49
|
+ /opt/odoo/additional_addons/ &&\
|
|
50
|
+ # Comment out modules not yet migrated on OCA for v14
|
|
51
|
+ #git clone -b 14.0 --depth 1 https://github.com/OCA/account-invoicing.git /tmp/oca-repos/account-invoicing &&\
|
|
52
|
+ #mv /tmp/oca-repos/account-invoicing/sale_timesheet_invoice_description \
|
|
53
|
+ # /opt/odoo/additional_addons/ &&\
|
|
54
|
+ git clone -b 14.0 --depth 1 https://github.com/OCA/bank-statement-import.git /tmp/oca-repos/bank-statement-import &&\
|
|
55
|
+ mv /tmp/oca-repos/bank-statement-import/account_statement_import \
|
|
56
|
+ /tmp/oca-repos/bank-statement-import/account_statement_import_ofx \
|
|
57
|
+ /opt/odoo/additional_addons/ &&\
|
|
58
|
+ git clone -b 14.0 --depth 1 https://github.com/OCA/partner-contact.git /tmp/oca-repos/partner-contact &&\
|
|
59
|
+ mv /tmp/oca-repos/partner-contact/partner_disable_gravatar \
|
|
60
|
+ /tmp/oca-repos/partner-contact/partner_firstname \
|
|
61
|
+ /opt/odoo/additional_addons/ &&\
|
|
62
|
+ git clone -b 14.0 --depth 1 https://github.com/OCA/project.git /tmp/oca-repos/project &&\
|
|
63
|
+ mv /tmp/oca-repos/project/project_category \
|
|
64
|
+ /tmp/oca-repos/project/project_status \
|
|
65
|
+ /tmp/oca-repos/project/project_task_default_stage \
|
|
66
|
+ /tmp/oca-repos/project/project_template \
|
|
67
|
+ /tmp/oca-repos/project/project_timeline \
|
|
68
|
+ /opt/odoo/additional_addons/ &&\
|
|
69
|
+ git clone -b 14.0 --depth 1 https://github.com/OCA/server-auth.git /tmp/oca-repos/server-auth &&\
|
|
70
|
+ mv /tmp/oca-repos/server-auth/password_security \
|
|
71
|
+ /opt/odoo/additional_addons/ &&\
|
|
72
|
+ git clone -b 14.0 --depth 1 https://github.com/OCA/server-brand.git /tmp/oca-repos/server-brand &&\
|
|
73
|
+ mv /tmp/oca-repos/server-brand/disable_odoo_online \
|
|
74
|
+ /tmp/oca-repos/server-brand/remove_odoo_enterprise \
|
|
75
|
+ /opt/odoo/additional_addons/ &&\
|
|
76
|
+ git clone -b 14.0 --depth 1 https://github.com/OCA/server-tools.git /tmp/oca-repos/server-tools &&\
|
|
77
|
+ mv /tmp/oca-repos/server-tools/base_search_fuzzy \
|
|
78
|
+ /opt/odoo/additional_addons/ &&\
|
|
79
|
+ git clone -b 14.0 --depth 1 https://github.com/OCA/server-ux.git /tmp/oca-repos/server-ux &&\
|
|
80
|
+ mv /tmp/oca-repos/server-ux/base_technical_features \
|
|
81
|
+ /tmp/oca-repos/server-ux/date_range \
|
|
82
|
+ /tmp/oca-repos/server-ux/mass_editing \
|
|
83
|
+ /opt/odoo/additional_addons/ &&\
|
|
84
|
+ git clone -b 14.0 --depth 1 https://github.com/OCA/social.git /tmp/oca-repos/social &&\
|
|
85
|
+ mv /tmp/oca-repos/social/base_search_mail_content \
|
|
86
|
+ /tmp/oca-repos/social/mail_debrand \
|
|
87
|
+ /opt/odoo/additional_addons/ &&\
|
|
88
|
+ git clone -b 14.0 --depth 1 https://github.com/OCA/web.git /tmp/oca-repos/web &&\
|
|
89
|
+ mv /tmp/oca-repos/web/web_environment_ribbon \
|
|
90
|
+ /tmp/oca-repos/web/web_responsive \
|
|
91
|
+ /tmp/oca-repos/web/web_timeline \
|
|
92
|
+ /opt/odoo/additional_addons/ &&\
|
|
93
|
+ rm -rf /tmp/oca-repos/ &&\
|
|
94
|
+ find /opt/odoo/additional_addons/*/i18n/ -type f -not -name 'fr.po' -delete &&\
|
|
95
|
+ chown -R odoo:odoo /opt/odoo
|
59
|
96
|
|
60
|
97
|
# Copy entrypoint script and Odoo configuration file
|
61
|
98
|
COPY ./entrypoint.sh /
|
62
|
|
-COPY ./odoo.conf /etc/odoo/
|
|
99
|
+COPY ./odoo.conf /opt/odoo/etc/odoo.conf
|
|
100
|
+RUN chown odoo:odoo /opt/odoo/etc/odoo.conf
|
63
|
101
|
|
64
|
|
-# Set permissions and Mount /var/lib/odoo to allow restoring filestore and /mnt/extra-addons for users addons
|
65
|
|
-RUN chown odoo /etc/odoo/odoo.conf \
|
66
|
|
- && mkdir -p /mnt/extra-addons \
|
67
|
|
- && chown -R odoo /mnt/extra-addons
|
68
|
|
-VOLUME ["/var/lib/odoo", "/mnt/extra-addons"]
|
|
102
|
+# Mount /opt/odoo/data to allow restoring filestore
|
|
103
|
+VOLUME ["/opt/odoo/data/"]
|
69
|
104
|
|
70
|
105
|
# Expose Odoo services
|
71
|
|
-EXPOSE 8069 8071 8072
|
72
|
|
-
|
73
|
|
-# Set the default config file
|
74
|
|
-ENV ODOO_RC /etc/odoo/odoo.conf
|
|
106
|
+EXPOSE 8069
|
75
|
107
|
|
76
|
108
|
COPY wait-for-psql.py /usr/local/bin/wait-for-psql.py
|
77
|
109
|
|
78
|
110
|
# Set default user when running the container
|
79
|
111
|
USER odoo
|
80
|
112
|
|
|
113
|
+# Start
|
81
|
114
|
ENTRYPOINT ["/entrypoint.sh"]
|
82
|
|
-CMD ["odoo"]
|
|
115
|
+CMD ["/opt/odoo/odoo/odoo-bin" "-c /opt/odoo/etc/odoo.conf"]
|
|
116
|
+
|
|
117
|
+# Metadata
|
|
118
|
+#LABEL org.label-schema.schema-version="14.0" \
|
|
119
|
+# org.label-schema.vendor=LeFilament \
|
|
120
|
+# org.label-schema.license=Apache-2.0 \
|
|
121
|
+# org.label-schema.vcs-url="https://sources.le-filament.com/lefilament/odoo_docker"
|