diff --git a/odoo/base.yml b/odoo/base.yml index f8e8a8e..c7c7990 100644 --- a/odoo/base.yml +++ b/odoo/base.yml @@ -21,6 +21,14 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: somethingToChange + odoo10: + extends: + service: odoo + build: + context: ./odoo + dockerfile: Dockerfile.10 + image: odoo:10.0 + odoocmd: build: ./scripts image: odoocmd:8.0 diff --git a/odoo/odoo/Dockerfile.10 b/odoo/odoo/Dockerfile.10 new file mode 100644 index 0000000..33bf318 --- /dev/null +++ b/odoo/odoo/Dockerfile.10 @@ -0,0 +1,68 @@ +FROM debian:jessie +MAINTAINER Yaltik - Fabien Bourgeois + +# Odoo dependencies from Debian APT repository +# WARNING: libpq, postgresql-client not 95 is a problem ? +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 \ + python-dev python-setuptools python-pip nodejs npm + +# Install NPM dependencies +RUN npm install -g less less-plugin-clean-css + +# PostgreSQL 9.5 +RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main 9.5" \ + > /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-9.5 + +# WKHTMLTOPDF and fonts +ENV WKNAME wkhtmltox-0.12.1.2_linux-jessie-amd64.deb +RUN apt-get install -y --no-install-recommends \ + libfontenc1 libxfont1 x11-common xfonts-75dpi xfonts-base \ + xfonts-encodings xfonts-utils \ + && curl -LO http://nightly.odoo.com/extra/$WKNAME \ + && echo "40e8b906de658a2221b15e4e8cd82565a47d7ee8 $WKNAME" | sha1sum -c - \ + && dpkg --force-depends -i $WKNAME \ + && apt-get -y install -f --no-install-recommends + +# Packages cleanup +RUN apt-get purge -y --auto-remove \ + && apt-get clean \ + && rm ${WKNAME} + +# Create odoo user +RUN useradd odoo -d /opt/odoo + +# Install OCB 8.0 latest +ENV ODOO_BRANCH 10.0 +WORKDIR /opt/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 pip install -U pip +RUN pip install -r OCB/requirements.txt --cache-dir pipcache + +# Handle Node PATH +RUN ln -s /usr/bin/nodejs /usr/bin/node + +# Launch scripts +COPY ./launch10.sh ./ +COPY ./genconf.sh ./ + +# Post-install tasks +RUN touch odoo.conf +RUN chown -R odoo . + +# Odoo default ports +EXPOSE 8069 8072 + +# Default user : odoo +USER odoo + +# Volumes : data dir for filestore and addons +VOLUME /opt/odoo/data + +CMD [ "bash", "launch10.sh" ] diff --git a/odoo/odoo/launch10.sh b/odoo/odoo/launch10.sh new file mode 100644 index 0000000..8c8f3e3 --- /dev/null +++ b/odoo/odoo/launch10.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +CONF=/opt/odoo/odoo.conf +ODOOCMD="python /opt/odoo/OCB/odoo-bin --config $CONF" + +# Configuration generation and Odoo launch +bash genconf.sh && $ODOOCMD