[ADD]Odoo 12 base, prod and dev

This commit is contained in:
Fabien BOURGEOIS 2018-12-08 09:19:13 +01:00
parent 9a625282df
commit 0fbf823796
9 changed files with 178 additions and 1 deletions

View File

@ -14,6 +14,13 @@ services:
POSTGRES_PASSWORD: somethingToChange POSTGRES_PASSWORD: somethingToChange
PGDATA: /opt/odoo/pgdata PGDATA: /opt/odoo/pgdata
postgres10:
image: registry.yaltik.net/postgres:yaltik10
environment:
POSTGRES_USER: odoo
POSTGRES_PASSWORD: somethingToChange
PGDATA: /opt/odoo/pgdata
odoo: odoo:
init: true init: true
build: ./odoo build: ./odoo
@ -120,6 +127,34 @@ services:
POSTGRES_USER: odoo POSTGRES_USER: odoo
POSTGRES_PASSWORD: somethingToChange 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: flectra:
init: true init: true
build: build:

View File

@ -53,6 +53,26 @@ services:
LIMIT_MEMORY_SOFT: 7000000000 LIMIT_MEMORY_SOFT: 7000000000
LIMIT_MEMORY_HARD: 16000000000 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: openupgrade9:
init: true init: true
build: build:

68
odoo/odoo/Dockerfile.12 Normal file
View File

@ -0,0 +1,68 @@
FROM debian:stretch
MAINTAINER Yaltik - Fabien Bourgeois <fabien@yaltik.com>
# 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" ]

View File

@ -0,0 +1,12 @@
FROM registry.yaltik.net/odoo:yaltik12
MAINTAINER Yaltik - Fabien Bourgeois <fabien@yaltik.com>
# 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

View File

@ -0,0 +1,17 @@
FROM registry.yaltik.net/odoo:yaltikbase12
MAINTAINER Yaltik - Fabien Bourgeois <fabien@yaltik.com>
# 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

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
CONF=/opt/odoo/odoo.conf 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 if [ $LOAD ]; then
ODOOCMD="$ODOOCMD --load=$LOAD" ODOOCMD="$ODOOCMD --load=$LOAD"

15
odoo/odoo/launch12.dev.sh Normal file
View File

@ -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

7
odoo/odoo/launch12.sh Normal file
View File

@ -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

3
odoo/odoo/shell12.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
python3 OCB/odoo-bin shell -c odoo.conf -d "$@" --no-xmlrpc