diff --git a/odoo/base.yml b/odoo/base.yml index b883992..74bf8cd 100644 --- a/odoo/base.yml +++ b/odoo/base.yml @@ -14,6 +14,13 @@ services: POSTGRES_PASSWORD: somethingToChange PGDATA: /opt/odoo/pgdata + postgres10: + image: registry.yaltik.net/postgres:yaltik10 + environment: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: somethingToChange + PGDATA: /opt/odoo/pgdata + odoo: init: true build: ./odoo @@ -120,6 +127,34 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: somethingToChange + odoobase12: + init: true + build: + context: ./odoo + dockerfile: Dockerfile.12 + image: registry.yaltik.net/odoo:yaltikbase12 + 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 + + odoo12: + init: true + extends: + file: base.yml + service: odoobase12 + build: + context: ./odoo + dockerfile: Dockerfile.ext.12 + image: registry.yaltik.net/odoo:yaltik12 + flectra: init: true build: diff --git a/odoo/dev.yml b/odoo/dev.yml index d53467f..b910ed9 100644 --- a/odoo/dev.yml +++ b/odoo/dev.yml @@ -53,6 +53,26 @@ services: LIMIT_MEMORY_SOFT: 7000000000 LIMIT_MEMORY_HARD: 16000000000 + odoodev12: + extends: + file: base.yml + service: odoo12 + build: + context: ./odoo + dockerfile: Dockerfile.12.dev + image: registry.yaltik.net/odoodev:yaltik12 + environment: + DEV: 1 + CODE_FOLDER: code + ADMIN_PASSWORD: dev + LIST_DB: "True" + DB_MAXCONN: 20 + WORKERS: 2 + LIMIT_TIME_CPU: 3000 + LIMIT_TIME_REAL: 6000 + LIMIT_MEMORY_SOFT: 7000000000 + LIMIT_MEMORY_HARD: 16000000000 + openupgrade9: init: true build: diff --git a/odoo/odoo/Dockerfile.12 b/odoo/odoo/Dockerfile.12 new file mode 100644 index 0000000..b81019b --- /dev/null +++ b/odoo/odoo/Dockerfile.12 @@ -0,0 +1,68 @@ +FROM debian:stretch +MAINTAINER Yaltik - Fabien Bourgeois + +# http://bugs.python.org/issue19846 +# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. +ENV LANG C.UTF-8 + +# Odoo dependencies from Debian APT repository +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + python3-pip python3-pyldap python3-qrcode python3-renderpm \ + python3-setuptools python3-vobject python3-watchdog python3-dev \ + build-essential git mercurial curl \ + libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libjpeg-dev libpq-dev \ + libfreetype6-dev libssl1.0-dev \ + nodejs node-less xz-utils + +# Handle Node PATH +RUN ln -s /usr/bin/nodejs /usr/bin/node + +# PostgreSQL 10.x +RUN apt-get update && apt-get install -y --no-install-recommends gnupg +RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" \ + > /etc/apt/sources.list.d/postgresql.list \ + && curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && apt-get update \ + && apt-get install -y libpq-dev postgresql-client-10 + +# WKHTMLTOPDF and fonts +RUN curl -o wkhtmltox.deb -SL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb \ + && echo '7e35a63f9db14f93ec7feeb0fce76b30c08f2057 wkhtmltox.deb' | sha1sum -c \ + && dpkg --force-depends -i wkhtmltox.deb \ + && apt-get -y --fix-broken install + +# 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 12.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 +# PATH update +RUN echo 'export PATH="$PATH:$HOME/.local/bin/"' >> /opt/odoo/.profile +RUN pip3 install --user -U pip +RUN .local/bin/pip3 install --user -r OCB/requirements.txt + +# Launch scripts +COPY ./launch12.sh ./launch.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", "launch.sh" ] diff --git a/odoo/odoo/Dockerfile.12.dev b/odoo/odoo/Dockerfile.12.dev new file mode 100644 index 0000000..da258e4 --- /dev/null +++ b/odoo/odoo/Dockerfile.12.dev @@ -0,0 +1,12 @@ +FROM registry.yaltik.net/odoo:yaltik12 +MAINTAINER Yaltik - Fabien Bourgeois + +# PostgreSQL CLI +RUN .local/bin/pip3 install --user pgcli +COPY pgcli.sh ./ +# Odoo specific +RUN .local/bin/pip3 install --user watchdog +COPY shell12.sh ./shell.sh +COPY i18n.sh ./i18n.sh +COPY launch12.dev.sh ./launch.sh +ENV DEV 1 diff --git a/odoo/odoo/Dockerfile.ext.12 b/odoo/odoo/Dockerfile.ext.12 new file mode 100644 index 0000000..8cdd2ca --- /dev/null +++ b/odoo/odoo/Dockerfile.ext.12 @@ -0,0 +1,17 @@ +FROM registry.yaltik.net/odoo:yaltikbase12 +MAINTAINER Yaltik - Fabien Bourgeois + +# External code +WORKDIR /opt/odoo/extra-addons +RUN git clone --depth 1 -b 12.0 https://github.com/OCA/community-data-files +RUN git clone --depth 1 -b 12.0 https://github.com/OCA/l10n-france +RUN git clone --depth 1 -b 12.0 https://github.com/OCA/partner-contact +RUN git clone --depth 1 -b 12.0 https://github.com/OCA/queue +RUN git clone --depth 1 -b 12.0 https://github.com/muk-it/muk_base +RUN git clone --depth 1 -b 12.0 https://github.com/muk-it/muk_misc +RUN git clone --depth 1 -b 12.0 https://github.com/muk-it/muk_web + +WORKDIR /opt/odoo + +# Addons dependencies +RUN .local/bin/pip3 install --user openupgradelib diff --git a/odoo/odoo/launch10.sh b/odoo/odoo/launch10.sh index c020b61..ec4bd68 100644 --- a/odoo/odoo/launch10.sh +++ b/odoo/odoo/launch10.sh @@ -1,7 +1,7 @@ #!/bin/bash CONF=/opt/odoo/odoo.conf -ODOOCMD="python /opt/odoo/OCB/odoo-bin --config $CONF" +ODOOCMD="python3 /opt/odoo/OCB/odoo-bin --config $CONF" if [ $LOAD ]; then ODOOCMD="$ODOOCMD --load=$LOAD" diff --git a/odoo/odoo/launch12.dev.sh b/odoo/odoo/launch12.dev.sh new file mode 100644 index 0000000..9430b06 --- /dev/null +++ b/odoo/odoo/launch12.dev.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +CONF=/opt/odoo/odoo.conf +ODOOCMD="python3 OCB/odoo-bin --config $CONF" + +if [ $LOAD ]; then + ODOOCMD="$ODOOCMD --load=$LOAD" +fi + +if [ "$DEV" == 1 ]; then + ODOOCMD="$ODOOCMD --dev all --log-handler :DEBUG" +fi + +# Configuration generation and Odoo launch +bash genconf.sh && $ODOOCMD diff --git a/odoo/odoo/launch12.sh b/odoo/odoo/launch12.sh new file mode 100644 index 0000000..4a87d5b --- /dev/null +++ b/odoo/odoo/launch12.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 diff --git a/odoo/odoo/shell12.sh b/odoo/odoo/shell12.sh new file mode 100644 index 0000000..0950da0 --- /dev/null +++ b/odoo/odoo/shell12.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +python3 OCB/odoo-bin shell -c odoo.conf -d "$@" --no-xmlrpc