From 28152c6ad7954309c54aa453cf8818cf9e9158c8 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Sun, 22 Oct 2017 07:36:22 +0200 Subject: [PATCH] [ADD]Base image for Odoo v11 --- odoo/base.yml | 18 +++++++++++++ odoo/odoo/Dockerfile.11 | 56 +++++++++++++++++++++++++++++++++++++++++ odoo/odoo/launch11.sh | 7 ++++++ 3 files changed, 81 insertions(+) create mode 100644 odoo/odoo/Dockerfile.11 create mode 100644 odoo/odoo/launch11.sh diff --git a/odoo/base.yml b/odoo/base.yml index ec585f1..deef51a 100644 --- a/odoo/base.yml +++ b/odoo/base.yml @@ -66,6 +66,24 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: somethingToChange + odoo11: + init: true + build: + context: ./odoo + dockerfile: Dockerfile.11 + image: registry.yaltik.net/odoo:yaltik11 + environment: + DB_MAXCONN: 20 + XMLRPC_PORT: 8069 + LONGPOLLING_PORT: 8072 + WORKERS: 2 + LIMIT_TIME_CPU: 720 + LIMIT_TIME_REAL: 1440 + ADMIN_PASSWORD: somethingToChange + LIST_DB: "False" + POSTGRES_USER: odoo + POSTGRES_PASSWORD: somethingToChange + odoocmd: build: context: ./scripts diff --git a/odoo/odoo/Dockerfile.11 b/odoo/odoo/Dockerfile.11 new file mode 100644 index 0000000..4992d9c --- /dev/null +++ b/odoo/odoo/Dockerfile.11 @@ -0,0 +1,56 @@ +FROM debian:stretch +MAINTAINER Yaltik - Fabien Bourgeois + +# Odoo dependencies from Debian APT repository +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + build-essential git mercurial curl \ + libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libjpeg-dev libpq-dev \ + libfreetype6-dev libssl1.0-dev \ + python3-dev python3-setuptools python3-pip python3-renderpm \ + nodejs node-less xz-utils \ + postgresql-client-9.6 + +# Handle Node PATH +RUN ln -s /usr/bin/nodejs /usr/bin/node + +# WKHTMLTOPDF and fonts +RUN curl -o wkhtmltox.tar.xz -SL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz \ + && echo '3f923f425d345940089e44c1466f6408b9619562 wkhtmltox.tar.xz' | sha1sum -c - \ + && tar xvf wkhtmltox.tar.xz \ + && cp wkhtmltox/lib/* /usr/local/lib/ \ + && cp wkhtmltox/bin/* /usr/local/bin/ \ + && cp -r wkhtmltox/share/man/man1 /usr/local/share/man/ + +# Packages cleanup +RUN apt-get purge -y --auto-remove \ + && apt-get clean \ + && rm -r ./wkhtmltox* + +# Create odoo user +RUN useradd odoo -md /opt/odoo + +# Install OCB 11.0 latest +ENV ODOO_BRANCH 11.0 +WORKDIR /opt/odoo +# Default user : odoo +USER odoo +RUN mkdir pipcache data backups extra-addons custom-addons +RUN git clone -b ${ODOO_BRANCH} --depth 1 https://github.com/OCA/OCB.git +RUN pip3 install --user -U pip +RUN pip3 install --user -r OCB/requirements.txt + +# Launch scripts +COPY ./launch11.sh ./ +COPY ./genconf.sh ./ + +# Post-install tasks +RUN touch odoo.conf + +# Odoo default ports +EXPOSE 8069 8072 + +# Volumes : data dir for filestore and addons +VOLUME /opt/odoo/data + +CMD [ "bash", "launch11.sh" ] diff --git a/odoo/odoo/launch11.sh b/odoo/odoo/launch11.sh new file mode 100644 index 0000000..4a87d5b --- /dev/null +++ b/odoo/odoo/launch11.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +CONF=/opt/odoo/odoo.conf +ODOOCMD="python3 /opt/odoo/OCB/odoo-bin --config $CONF" + +# Configuration generation and Odoo launch +bash genconf.sh && $ODOOCMD