From ed562babbc3d9c573fb7b817b342b4ba11d68966 Mon Sep 17 00:00:00 2001 From: Anass Ahmed Date: Fri, 2 Oct 2015 01:45:25 +0200 Subject: [PATCH 1/6] Installed low-level renderpm for barcodes Odoo deb package has no dependency on python-renderpm which is needed by python-reportlab to support printing barcodes! --- 8.0/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 9a69b94..0957059 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -11,6 +11,7 @@ RUN set -x; \ npm \ python-support \ python-pyinotify \ + python-renderpm \ && npm install -g less less-plugin-clean-css \ && ln -s /usr/bin/nodejs /usr/bin/node \ && curl -o wkhtmltox.deb -SL http://nightly.odoo.com/extra/wkhtmltox-0.12.1.2_linux-jessie-amd64.deb \ From dbce067bb4fd7b5797b2d6e0cb63eee875226ef4 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 8 Oct 2015 10:16:44 +0200 Subject: [PATCH 2/6] [IMP] Update Odoo to version 20151008 --- 8.0/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 0957059..7927b0b 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -23,7 +23,7 @@ RUN set -x; \ # Install Odoo ENV ODOO_VERSION 8.0 -ENV ODOO_RELEASE 20150401 +ENV ODOO_RELEASE 20151008 RUN set -x; \ curl -o odoo.deb -SL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ && dpkg --force-depends -i odoo.deb \ From fac64b785d4bf8d6ef24f062700c109965f9b2f3 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 8 Oct 2015 10:59:38 +0200 Subject: [PATCH 3/6] [FIX] Dockerfile: let odoo user owner of /mnt/extra-addons This allows to directly create new addons in /mnt/extra-addons from inside the container, e.g. using odoo scaffolding. Closes #21. --- 8.0/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 7927b0b..95b44e2 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -37,6 +37,8 @@ COPY ./openerp-server.conf /etc/odoo/ RUN chown odoo /etc/odoo/openerp-server.conf # Mount /var/lib/odoo to allow restoring filestore and /mnt/extra-addons for users addons +RUN mkdir -p /mnt/extra-addons \ + && chown -R odoo /mnt/extra-addons VOLUME ["/var/lib/odoo", "/mnt/extra-addons"] # Expose Odoo services From 3b21d6757b9f9853580954bb0092b0920b20ce6d Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 8 Oct 2015 12:26:50 +0200 Subject: [PATCH 4/6] [IMP] Dockerfile: install lessc from jessie's packages --- 8.0/Dockerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/8.0/Dockerfile b/8.0/Dockerfile index 95b44e2..fbd4237 100644 --- a/8.0/Dockerfile +++ b/8.0/Dockerfile @@ -7,13 +7,11 @@ RUN set -x; \ && apt-get install -y --no-install-recommends \ ca-certificates \ curl \ - nodejs \ - npm \ - python-support \ + node-less \ + node-clean-css \ python-pyinotify \ python-renderpm \ - && npm install -g less less-plugin-clean-css \ - && ln -s /usr/bin/nodejs /usr/bin/node \ + python-support \ && curl -o wkhtmltox.deb -SL http://nightly.odoo.com/extra/wkhtmltox-0.12.1.2_linux-jessie-amd64.deb \ && echo '40e8b906de658a2221b15e4e8cd82565a47d7ee8 wkhtmltox.deb' | sha1sum -c - \ && dpkg --force-depends -i wkhtmltox.deb \ From 4df13f14259e3b417a5b2d4b3c1c344a0314a832 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 8 Oct 2015 10:17:16 +0200 Subject: [PATCH 5/6] [IMP] openerp-server.conf: custom addons take priority over odoo addons Moving the extra addons folder before the odoo addons folder in the addons_path allows to use custom implementation of a given addon (if there are two addons with the same name, one in extra-addons, the other in openerp/addons, the first one will take priority over the second one which will simply be ignored). --- 8.0/openerp-server.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/8.0/openerp-server.conf b/8.0/openerp-server.conf index 679610c..0a1a0ed 100644 --- a/8.0/openerp-server.conf +++ b/8.0/openerp-server.conf @@ -1,5 +1,5 @@ [options] -addons_path = /usr/lib/python2.7/dist-packages/openerp/addons,/mnt/extra-addons +addons_path = /mnt/extra-addons,/usr/lib/python2.7/dist-packages/openerp/addons data_dir = /var/lib/odoo auto_reload = True ; admin_passwd = admin From 6e12a6494782a2aec83346cae9c77d971b0d73b3 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 8 Oct 2015 11:21:13 +0200 Subject: [PATCH 6/6] [ADD] Odoo 9.0 Closes #32. --- 9.0/Dockerfile | 52 +++++++++++++++++++++++++++++++++++++++++ 9.0/entrypoint.sh | 24 +++++++++++++++++++ 9.0/openerp-server.conf | 38 ++++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 9.0/Dockerfile create mode 100755 9.0/entrypoint.sh create mode 100644 9.0/openerp-server.conf diff --git a/9.0/Dockerfile b/9.0/Dockerfile new file mode 100644 index 0000000..792a880 --- /dev/null +++ b/9.0/Dockerfile @@ -0,0 +1,52 @@ +FROM debian:jessie +MAINTAINER Odoo S.A. + +# Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf +RUN set -x; \ + apt-get update \ + && apt-get install -y --no-install-recommends \ + ca-certificates \ + curl \ + node-less \ + node-clean-css \ + python-pyinotify \ + python-renderpm \ + python-support \ + && curl -o wkhtmltox.deb -SL http://nightly.odoo.com/extra/wkhtmltox-0.12.1.2_linux-jessie-amd64.deb \ + && echo '40e8b906de658a2221b15e4e8cd82565a47d7ee8 wkhtmltox.deb' | sha1sum -c - \ + && dpkg --force-depends -i wkhtmltox.deb \ + && apt-get -y install -f --no-install-recommends \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false npm \ + && rm -rf /var/lib/apt/lists/* wkhtmltox.deb + +# Install Odoo +ENV ODOO_VERSION 9.0 +ENV ODOO_RELEASE 20151008 +RUN set -x; \ + curl -o odoo.deb -SL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \ + && dpkg --force-depends -i odoo.deb \ + && apt-get update \ + && apt-get -y install -f --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* odoo.deb + +# Copy entrypoint script and Odoo configuration file +COPY ./entrypoint.sh / +COPY ./openerp-server.conf /etc/odoo/ +RUN chown odoo /etc/odoo/openerp-server.conf + +# Mount /var/lib/odoo to allow restoring filestore and /mnt/extra-addons for users addons +RUN mkdir -p /mnt/extra-addons \ + && chown -R odoo /mnt/extra-addons +VOLUME ["/var/lib/odoo", "/mnt/extra-addons"] + +# Expose Odoo services +EXPOSE 8069 8071 + +# Set the default config file +ENV OPENERP_SERVER /etc/odoo/openerp-server.conf + +# Set default user when running the container +USER odoo + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["openerp-server"] diff --git a/9.0/entrypoint.sh b/9.0/entrypoint.sh new file mode 100755 index 0000000..8ec01b4 --- /dev/null +++ b/9.0/entrypoint.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +# set odoo database host, port, user and password +: ${PGHOST:=$DB_PORT_5432_TCP_ADDR} +: ${PGPORT:=$DB_PORT_5432_TCP_PORT} +: ${PGUSER:=${DB_ENV_POSTGRES_USER:='postgres'}} +: ${PGPASSWORD:=$DB_ENV_POSTGRES_PASSWORD} +export PGHOST PGPORT PGUSER PGPASSWORD + +case "$1" in + --) + shift + exec openerp-server "$@" + ;; + -*) + exec openerp-server "$@" + ;; + *) + exec "$@" +esac + +exit 1 diff --git a/9.0/openerp-server.conf b/9.0/openerp-server.conf new file mode 100644 index 0000000..0a1a0ed --- /dev/null +++ b/9.0/openerp-server.conf @@ -0,0 +1,38 @@ +[options] +addons_path = /mnt/extra-addons,/usr/lib/python2.7/dist-packages/openerp/addons +data_dir = /var/lib/odoo +auto_reload = True +; admin_passwd = admin +; csv_internal_sep = , +; db_maxconn = 64 +; db_name = False +; db_template = template1 +; dbfilter = .* +; debug_mode = False +; email_from = False +; limit_memory_hard = 2684354560 +; limit_memory_soft = 2147483648 +; limit_request = 8192 +; limit_time_cpu = 60 +; limit_time_real = 120 +; list_db = True +; log_db = False +; log_handler = [':INFO'] +; log_level = info +; logfile = None +; longpolling_port = 8072 +; max_cron_threads = 2 +; osv_memory_age_limit = 1.0 +; osv_memory_count_limit = False +; smtp_password = False +; smtp_port = 25 +; smtp_server = localhost +; smtp_ssl = False +; smtp_user = False +; workers = 0 +; xmlrpc = True +; xmlrpc_interface = +; xmlrpc_port = 8069 +; xmlrpcs = True +; xmlrpcs_interface = +; xmlrpcs_port = 8071