[ADD] uber commit - see descriptions :
- use "docker" folder directly (without sub folders) - use suffix to differentiate all docker files - create a Dockerfile for dev called Dockerfile.dev - refactor the base docker file to accept Dockerfile.dev changes. Change his name for Dockerfile.core. - Adapt the production docker file to accept Dockerfile.core and change his name for name Dockerfile.main
This commit is contained in:
parent
a2ba60dff3
commit
7de2b52bf8
11 changed files with 1095 additions and 0 deletions
13
.travis.yml
Normal file
13
.travis.yml
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
language: minimal
|
||||||
|
|
||||||
|
services:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
script:
|
||||||
|
- docker build -f docker/Dockerfile.core -t technolibre/erplibre-core:12.0 docker/
|
||||||
|
- docker build -f docker/Dockerfile.dev -t technolibre/erplibre:12.0 docker/
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
- docker login --username mikefaille --password "${DOCKER_TOKEN}"
|
||||||
|
- docker push technolibre/erplibre-core:12.0
|
||||||
|
- docker push technolibre/erplibre:12.0
|
||||||
48
docker-compose.yml
Normal file
48
docker-compose.yml
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
version: "3.3"
|
||||||
|
services:
|
||||||
|
ERPLibre:
|
||||||
|
image: technolibre/erplibre-dev:12.0
|
||||||
|
ports:
|
||||||
|
- 8069:8069
|
||||||
|
environment:
|
||||||
|
HOST: db
|
||||||
|
PASSWORD: mysecretpassword
|
||||||
|
USER: odoo
|
||||||
|
POSTGRES_DB: odoo
|
||||||
|
CURRENT_UID: ${CURRENT_UID}
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
networks:
|
||||||
|
- front
|
||||||
|
command: odoo -c /ERPLibre/odoo/odoo.conf --without-demo=ALL -i base -d odoo
|
||||||
|
user: ${CURRENT_UID:?"Please run as follows 'CURRENT_UID=$(id -u):$(id -g) docker-compose up'"}
|
||||||
|
# user:
|
||||||
|
volumes:
|
||||||
|
- .:/ERPLibre
|
||||||
|
# See the volume section at the end of the file
|
||||||
|
- erplibre_data_dir:/var/lib/odoo
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgres:12.3
|
||||||
|
environment:
|
||||||
|
POSTGRES_PASSWORD: mysecretpassword
|
||||||
|
POSTGRES_USER: odoo
|
||||||
|
POSTGRES_DB: odoo
|
||||||
|
networks:
|
||||||
|
- front
|
||||||
|
|
||||||
|
|
||||||
|
networks:
|
||||||
|
front:
|
||||||
|
|
||||||
|
driver: bridge
|
||||||
|
ipam:
|
||||||
|
driver: default
|
||||||
|
config:
|
||||||
|
- subnet: 172.16.237.0/24
|
||||||
|
|
||||||
|
# We configure volume without specific destination to let docket manage it. To configure it through docker use (read related documentation before continuing) :
|
||||||
|
# - docker volume --help
|
||||||
|
# - docker-compose down --help
|
||||||
|
volumes:
|
||||||
|
erplibre_data_dir:
|
||||||
92
docker/Dockerfile
Normal file
92
docker/Dockerfile
Normal file
|
|
@ -0,0 +1,92 @@
|
||||||
|
FROM debian:buster-slim
|
||||||
|
MAINTAINER Odoo S.A. <info@odoo.com>
|
||||||
|
|
||||||
|
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]
|
||||||
|
|
||||||
|
# Generate locale C.UTF-8 for postgres and general locale data
|
||||||
|
ENV LANG C.UTF-8
|
||||||
|
|
||||||
|
# Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
dirmngr \
|
||||||
|
fonts-noto-cjk \
|
||||||
|
gnupg \
|
||||||
|
libssl-dev \
|
||||||
|
node-less \
|
||||||
|
npm \
|
||||||
|
python3-num2words \
|
||||||
|
python3-pip \
|
||||||
|
python3-phonenumbers \
|
||||||
|
python3-pyldap \
|
||||||
|
python3-qrcode \
|
||||||
|
python3-renderpm \
|
||||||
|
python3-setuptools \
|
||||||
|
python3-slugify \
|
||||||
|
python3-vobject \
|
||||||
|
python3-watchdog \
|
||||||
|
python3-xlrd \
|
||||||
|
python3-xlwt \
|
||||||
|
xz-utils \
|
||||||
|
git \
|
||||||
|
iproute2 \
|
||||||
|
inetutils-ping \
|
||||||
|
&& curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb \
|
||||||
|
&& echo '7e35a63f9db14f93ec7feeb0fce76b30c08f2057 wkhtmltox.deb' | sha1sum -c - \
|
||||||
|
&& apt-get install -y --no-install-recommends ./wkhtmltox.deb \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* wkhtmltox.deb
|
||||||
|
|
||||||
|
# install latest postgresql-client
|
||||||
|
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main' > /etc/apt/sources.list.d/pgdg.list \
|
||||||
|
&& GNUPGHOME="$(mktemp -d)" \
|
||||||
|
&& export GNUPGHOME \
|
||||||
|
&& repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' \
|
||||||
|
&& gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \
|
||||||
|
&& gpg --batch --armor --export "${repokey}" > /etc/apt/trusted.gpg.d/pgdg.gpg.asc \
|
||||||
|
&& gpgconf --kill all \
|
||||||
|
&& rm -rf "$GNUPGHOME" \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install --no-install-recommends -y postgresql-client \
|
||||||
|
&& rm -f /etc/apt/sources.list.d/pgdg.list \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Install Odoo
|
||||||
|
ENV ODOO_VERSION 12.0
|
||||||
|
ARG ODOO_RELEASE=20200417
|
||||||
|
ARG ODOO_SHA=ca4a7485b0b75850ffe1458a8f3266839400a501
|
||||||
|
RUN curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \
|
||||||
|
&& echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get -y install --no-install-recommends ./odoo.deb \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* odoo.deb
|
||||||
|
|
||||||
|
# Copy entrypoint script and Odoo configuration file
|
||||||
|
COPY ./entrypoint.sh /
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
COPY ./odoo.conf /etc/odoo/
|
||||||
|
|
||||||
|
# Mount /var/lib/odoo to allow restoring filestore and /mnt/extra-addons for users addons
|
||||||
|
RUN chown odoo /etc/odoo/odoo.conf \
|
||||||
|
&& mkdir -p /mnt/extra-addons \
|
||||||
|
&& chown -R odoo /mnt/extra-addons
|
||||||
|
# VOLUME ["/var/lib/odoo", "/mnt/extra-addons"]
|
||||||
|
|
||||||
|
# Expose Odoo services
|
||||||
|
EXPOSE 8069 8071 8072
|
||||||
|
|
||||||
|
# Set the default config file
|
||||||
|
ENV ODOO_RC /etc/odoo/odoo.conf
|
||||||
|
|
||||||
|
COPY wait-for-psql.py /usr/local/bin/wait-for-psql.py
|
||||||
|
|
||||||
|
RUN chmod +X /usr/local/bin/wait-for-psql.py
|
||||||
|
|
||||||
|
# Set default user when running the container
|
||||||
|
USER odoo
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
CMD ["odoo"]
|
||||||
144
docker/Dockerfile.core
Normal file
144
docker/Dockerfile.core
Normal file
|
|
@ -0,0 +1,144 @@
|
||||||
|
FROM debian:buster-slim
|
||||||
|
MAINTAINER Odoo S.A. <info@odoo.com>
|
||||||
|
|
||||||
|
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]
|
||||||
|
|
||||||
|
# Generate locale C.UTF-8 for postgres and general locale data
|
||||||
|
ENV LANG C.UTF-8
|
||||||
|
|
||||||
|
ENV ODOO_EXEC_BIN odoo
|
||||||
|
ENV ODOO_PREFIX /ERPLibre
|
||||||
|
|
||||||
|
|
||||||
|
# Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
dirmngr \
|
||||||
|
fonts-noto-cjk \
|
||||||
|
gnupg \
|
||||||
|
libssl-dev \
|
||||||
|
node-less \
|
||||||
|
npm \
|
||||||
|
python3-num2words \
|
||||||
|
python3-pip \
|
||||||
|
python3-phonenumbers \
|
||||||
|
python3-pyldap \
|
||||||
|
python3-qrcode \
|
||||||
|
python3-renderpm \
|
||||||
|
python3-setuptools \
|
||||||
|
python3-slugify \
|
||||||
|
python3-vobject \
|
||||||
|
python3-watchdog \
|
||||||
|
python3-xlrd \
|
||||||
|
python3-xlwt \
|
||||||
|
python3-babel \
|
||||||
|
python3-psycopg2 \
|
||||||
|
xz-utils \
|
||||||
|
git \
|
||||||
|
iproute2 \
|
||||||
|
inetutils-ping \
|
||||||
|
&& curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb \
|
||||||
|
&& echo '7e35a63f9db14f93ec7feeb0fce76b30c08f2057 wkhtmltox.deb' | sha1sum -c - \
|
||||||
|
&& apt-get install -y --no-install-recommends ./wkhtmltox.deb \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* wkhtmltox.deb
|
||||||
|
|
||||||
|
|
||||||
|
# dpkg-deb -I odoo.deb | grep Depends: | sed "s/ /\\n/g" | egrep '^python\-*' | sed "s/,//g"
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
python3-dateutil \
|
||||||
|
python3-decorator \
|
||||||
|
python3-docutils \
|
||||||
|
python3-feedparser \
|
||||||
|
python3-gevent \
|
||||||
|
python3-html2text \
|
||||||
|
python3-jinja2 \
|
||||||
|
python3-libsass \
|
||||||
|
python3-lxml \
|
||||||
|
python3-mako \
|
||||||
|
python3-mock \
|
||||||
|
python3-ofxparse \
|
||||||
|
python3-passlib \
|
||||||
|
python3-pil \
|
||||||
|
python3-psutil \
|
||||||
|
python3-psycopg2 \
|
||||||
|
python3-pydot \
|
||||||
|
python3-pyparsing \
|
||||||
|
python3-pypdf2 \
|
||||||
|
python3-reportlab \
|
||||||
|
python3-requests \
|
||||||
|
python3-serial \
|
||||||
|
python3-suds \
|
||||||
|
python3-tz \
|
||||||
|
python3-usb \
|
||||||
|
python3-vatnumber \
|
||||||
|
python3-werkzeug \
|
||||||
|
python3-xlsxwriter \
|
||||||
|
python3-chardet \
|
||||||
|
python3-xlrd \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# install latest postgresql-client
|
||||||
|
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main' > /etc/apt/sources.list.d/pgdg.list \
|
||||||
|
&& GNUPGHOME="$(mktemp -d)" \
|
||||||
|
&& export GNUPGHOME \
|
||||||
|
&& repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' \
|
||||||
|
&& gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \
|
||||||
|
&& gpg --batch --armor --export "${repokey}" > /etc/apt/trusted.gpg.d/pgdg.gpg.asc \
|
||||||
|
&& gpgconf --kill all \
|
||||||
|
&& rm -rf "$GNUPGHOME" \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install --no-install-recommends -y postgresql-client-12 \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN ln -s /usr/lib/postgresql/12/bin/pg_config /usr/bin/pg_config
|
||||||
|
|
||||||
|
RUN cd ; mkdir -p .bin/ && \
|
||||||
|
git config --global color.ui false && \
|
||||||
|
git config --global user.email "foo@bar.io" && \
|
||||||
|
git config --global user.name "Foo Bar" && \
|
||||||
|
curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/bin/repo && \
|
||||||
|
chmod +x /usr/bin/repo && sed -i '1 s/python$/python3/' /usr/bin/repo
|
||||||
|
|
||||||
|
|
||||||
|
RUN groupadd --gid 101 --force odoo && \
|
||||||
|
useradd --non-unique --create-home --uid 101 --gid 101 odoo
|
||||||
|
|
||||||
|
|
||||||
|
# Copy entrypoint script and Odoo configuration file
|
||||||
|
COPY ./entrypoint.sh /
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
|
||||||
|
# # Set the default config file
|
||||||
|
ENV ODOO_RC /etc/odoo/odoo.conf
|
||||||
|
COPY ./odoo.conf $ODOO_RC
|
||||||
|
RUN chown odoo $ODOO_RC
|
||||||
|
|
||||||
|
RUN mkdir $ODOO_PREFIX && \
|
||||||
|
chown odoo $ODOO_PREFIX && \
|
||||||
|
chmod 1777 $ODOO_PREFIX
|
||||||
|
|
||||||
|
# # Mount /var/lib/odoo to allow restoring filestore
|
||||||
|
RUN chown odoo $ODOO_RC
|
||||||
|
|
||||||
|
# Expose Odoo services
|
||||||
|
EXPOSE 8069 8071 8072
|
||||||
|
|
||||||
|
COPY wait-for-psql.py /usr/local/bin/wait-for-psql.py
|
||||||
|
|
||||||
|
RUN chmod +X /usr/local/bin/wait-for-psql.py
|
||||||
|
|
||||||
|
RUN mkdir -p /var/lib/odoo && \
|
||||||
|
chown odoo /var/lib/odoo && \
|
||||||
|
chmod 1777 /var/lib/odoo
|
||||||
|
|
||||||
|
VOLUME /var/lib/odoo
|
||||||
|
|
||||||
|
# Set default user when running the container
|
||||||
|
USER odoo
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
CMD ["odoo"]
|
||||||
41
docker/Dockerfile.dev
Normal file
41
docker/Dockerfile.dev
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
FROM technolibre/erplibre-core:12.0
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
RUN apt update && \
|
||||||
|
apt install -y -y --no-install-recommends \
|
||||||
|
build-essential \
|
||||||
|
wget \
|
||||||
|
python3-dev \
|
||||||
|
python3-venv \
|
||||||
|
python3-wheel \
|
||||||
|
libxslt-dev \
|
||||||
|
libzip-dev \
|
||||||
|
libldap2-dev \
|
||||||
|
libsasl2-dev \
|
||||||
|
python3-setuptools \
|
||||||
|
libpng16-16 \
|
||||||
|
gdebi \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& npm install -g rtlcss
|
||||||
|
|
||||||
|
# RUN pip3 install -r https://raw.githubusercontent.com/odoo/odoo/12.0/requirements.txt --ignore-installed psycopg2 && pip3a cache purge
|
||||||
|
|
||||||
|
ENV ADDONS_BASE_DIR /ERPLibre
|
||||||
|
ENV ENV=dev
|
||||||
|
|
||||||
|
# Copy entrypoint script and Odoo configuration file
|
||||||
|
COPY ./entrypoint.sh /
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
ENV ODOO_PREFIX /ERPLibre
|
||||||
|
ENV ODOO_EXEC_BIN $ODOO_PREFIX/odoo/odoo-bin
|
||||||
|
|
||||||
|
|
||||||
|
COPY repo_manifest_gen_org_prefix_path.py /usr/bin/
|
||||||
|
RUN chmod +x /usr/bin/repo_manifest_gen_org_prefix_path.py
|
||||||
|
|
||||||
|
USER odoo
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
CMD ["odoo"]
|
||||||
38
docker/Dockerfile.main
Normal file
38
docker/Dockerfile.main
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
FROM technolibre/erplibre-core:12.0
|
||||||
|
|
||||||
|
ENV REPO_MANIFEST_URL https://github.com/agileops/ERPLibre.git
|
||||||
|
RUN cat /etc/os-release
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
# Install Odoo
|
||||||
|
ENV ODOO_VERSION 12.0
|
||||||
|
ARG ODOO_RELEASE=20200417
|
||||||
|
ARG ODOO_SHA=ca4a7485b0b75850ffe1458a8f3266839400a501
|
||||||
|
RUN curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \
|
||||||
|
&& echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew install --no-install-recommends ./odoo.deb \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* odoo.deb
|
||||||
|
|
||||||
|
|
||||||
|
RUN mkdir ~/.ssh/ && echo "StrictHostKeyChecking no" >> ~/.ssh/config && apt update && apt install ssh-client git -y --no-install-recommends && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN cd ; mkdir -p .bin/ && \
|
||||||
|
git config --global color.ui false && \
|
||||||
|
git config --global user.email "foo@bar.io" && \
|
||||||
|
git config --global user.name "Foo Bar" && \
|
||||||
|
mkdir -p $ODOO_PREFIX && cd $ODOO_PREFIX && \
|
||||||
|
repo init -u $REPO_MANIFEST_URL -b 12.0_repo && \
|
||||||
|
repo sync -j 4 -c
|
||||||
|
|
||||||
|
ADD repo_manifest_gen_org_prefix_path.py /root/.bin/
|
||||||
|
RUN chmod +x ~/.bin/repo_manifest_gen_org_prefix_path.py
|
||||||
|
|
||||||
|
RUN head /etc/odoo/odoo.conf && /root/.bin/repo_manifest_gen_org_prefix_path.py $ODOO_PREFIX/addons /etc/odoo/odoo.conf /etc/odoo/odoo.conf && head /etc/odoo/odoo.conf
|
||||||
|
|
||||||
|
user odoo
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
CMD ["odoo"]
|
||||||
85
docker/entrypoint.sh
Executable file
85
docker/entrypoint.sh
Executable file
|
|
@ -0,0 +1,85 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
if [[ "$ENV" == "dev" ]] && [ ! -z ${CURRENT_UID} ]
|
||||||
|
then
|
||||||
|
export HOME=$ODOO_PREFIX
|
||||||
|
cd $HOME
|
||||||
|
|
||||||
|
# As it's only possible to fetch git repos manifest from an git url, we create one using git-daemon.
|
||||||
|
git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose &
|
||||||
|
GIT_PID=$!
|
||||||
|
echo "my repo" $(git rev-parse --abbrev-ref HEAD)
|
||||||
|
repo init -u git://127.0.0.1:9418/ -b $(git rev-parse --abbrev-ref HEAD) -m default.dev.xml
|
||||||
|
|
||||||
|
repo sync
|
||||||
|
|
||||||
|
# After sync, terminate the git checkout. We don't need graceful kill as we don't do commit on the git repo during the operation.
|
||||||
|
kill -9 $GIT_PID
|
||||||
|
|
||||||
|
ls $HOME/odoo/odoo-bin
|
||||||
|
# $? give the posix return value of the last command. 0 == success
|
||||||
|
# then IS_ODOO_FILE_EXIST : 0 == YES
|
||||||
|
IS_ODOO_FILE_EXIST=$?
|
||||||
|
|
||||||
|
if [ "$IS_ODOO_FILE_EXIST" -ne "0" ]; then
|
||||||
|
echo "The file $HOME/odoo/odoo-bin doesnt exist. Verify entrypoint.sh";
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add the odoo bins code on $PATH
|
||||||
|
echo PATH=$HOME/odoo/:$PATH
|
||||||
|
|
||||||
|
# Configure an alias to use "odoo-bin" as "odoo".
|
||||||
|
alias odoo=odoo-bin
|
||||||
|
|
||||||
|
repo_manifest_gen_org_prefix_path.py $ODOO_PREFIX/addons $ODOO_RC $ODOO_PREFIX/odoo/odoo.conf && head $ODOO_PREFIX/odoo/odoo.conf
|
||||||
|
export ODOO_RC=$ODOO_PREFIX/odoo/odoo.conf
|
||||||
|
|
||||||
|
elif [[ "$ENV" == "dev" ]] && [ -z ${CURRENT_UID} ]
|
||||||
|
then
|
||||||
|
echo 'Please run as follows : CURRENT_UID=$(id -u):$(id -g) docker-compose up'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set the postgres database host, port, user and password according to the environment
|
||||||
|
# and pass them as arguments to the odoo process if not present in the config file
|
||||||
|
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}
|
||||||
|
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
|
||||||
|
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
|
||||||
|
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
|
||||||
|
|
||||||
|
DB_ARGS=()
|
||||||
|
function check_config() {
|
||||||
|
param="$1"
|
||||||
|
value="$2"
|
||||||
|
if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then
|
||||||
|
value=$(grep -E "^\s*\b${param}\b\s*=" "$ODOO_RC" |cut -d " " -f3|sed 's/["\n\r]//g')
|
||||||
|
fi;
|
||||||
|
DB_ARGS+=("--${param}")
|
||||||
|
DB_ARGS+=("${value}")
|
||||||
|
}
|
||||||
|
check_config "db_host" "$HOST"
|
||||||
|
check_config "db_port" "$PORT"
|
||||||
|
check_config "db_user" "$USER"
|
||||||
|
check_config "db_password" "$PASSWORD"
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
-- | odoo)
|
||||||
|
shift
|
||||||
|
if [[ "$1" == "scaffold" ]] ; then
|
||||||
|
exec odoo "$@" || exec odoo-bin "$@"
|
||||||
|
else
|
||||||
|
wait-for-psql.py ${DB_ARGS[@]} --timeout=30
|
||||||
|
exec $ODOO_EXEC_BIN "$@" "${DB_ARGS[@]}"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
-*)
|
||||||
|
wait-for-psql.py ${DB_ARGS[@]} --timeout=30
|
||||||
|
exec $ODOO_EXEC_BIN "$@" "${DB_ARGS[@]}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
exec "$@"
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 1
|
||||||
32
docker/main/Dockerfile
Normal file
32
docker/main/Dockerfile
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
FROM technolibre/erplibre-base:12.0
|
||||||
|
|
||||||
|
ENV REPO_MANIFEST_URL https://github.com/agileops/ERPLibre.git
|
||||||
|
RUN cat /etc/os-release
|
||||||
|
|
||||||
|
ENV ADDONS_BASE_DIR /odoo
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
RUN mkdir ~/.ssh/ && echo "StrictHostKeyChecking no" >> ~/.ssh/config && apt update && apt install ssh-client git -y --no-install-recommends && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN cd ; mkdir -p .bin/ && \
|
||||||
|
git config --global color.ui false && \
|
||||||
|
git config --global user.email "foo@bar.io" && \
|
||||||
|
git config --global user.name "Foo Bar" && \
|
||||||
|
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo && \
|
||||||
|
chmod +x ~/.bin/repo && sed -i '1 s/python$/python3/' ~/.bin/repo && head ~/.bin/repo && \
|
||||||
|
export PATH="${HOME}/.bin:${PATH}" && \
|
||||||
|
mkdir -p $ADDONS_BASE_DIR && cd $ADDONS_BASE_DIR && \
|
||||||
|
repo init -u $REPO_MANIFEST_URL -b 12.0_repo && \
|
||||||
|
repo sync -j 4 -c
|
||||||
|
|
||||||
|
ADD repo_manifest_gen_org_prefix_path.py /root/.bin/ RUN chmod +x
|
||||||
|
~/.bin/repo_manifest_gen_org_prefix_path.py
|
||||||
|
|
||||||
|
RUN head /etc/odoo/odoo.conf && /root/.bin/repo_manifest_gen_org_prefix_path.py $ADDONS_BASE_DIR/addons /etc/odoo/odoo.conf /etc/odoo/odoo.conf && head /etc/odoo/odoo.conf
|
||||||
|
|
||||||
|
user odoo
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
CMD ["odoo"]
|
||||||
523
docker/odoo.conf
Normal file
523
docker/odoo.conf
Normal file
|
|
@ -0,0 +1,523 @@
|
||||||
|
[options]
|
||||||
|
|
||||||
|
#
|
||||||
|
# WARNING:
|
||||||
|
# If you use the Odoo Database utility to change the master password be aware
|
||||||
|
# that the formatting of this file WILL be LOST! A copy of this file named
|
||||||
|
# /etc/odoo/openerp-server.conf.template has been made in case this happens
|
||||||
|
# Note that the copy does not have any first boot changes
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Odoo Server Config File - TurnKey Linux
|
||||||
|
# ( /etc/odoo/openerp-server.conf )
|
||||||
|
#
|
||||||
|
# Great pain has been taken to organize this file, and include comments for
|
||||||
|
# each. As with all open source software this file is a work in progress. If
|
||||||
|
# you see something that is wrong or needs to be updated, submit and issue
|
||||||
|
# on TurnKey's GIT Hub issue tracker! Or better yet, fork the repo with this
|
||||||
|
# file and submit a pull request!
|
||||||
|
#
|
||||||
|
# Information about these settings where taken from openerp-server --help
|
||||||
|
# and from https://www.odoo.com/documentation/8.0/reference/cmdline.html
|
||||||
|
#
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Index:
|
||||||
|
# Database Settings
|
||||||
|
# Logs Settings
|
||||||
|
# Service Settings
|
||||||
|
# Email Settings
|
||||||
|
# Server Options
|
||||||
|
# Tuning Adjustments
|
||||||
|
# Testing and Demo Settings
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
||||||
|
# Database Settings
|
||||||
|
#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Specify the database host (default localhost).
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
#db_host = localhost
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Specify the database port (default None).
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
#db_port = 5432
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Specify the database user name (default None).
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
#db_user = odoo
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Specify the database password for db_user (default None)
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
db_password = 00aa9df39b0c99ac3d1d8412d2917175
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Specify the database name.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
db_name = False
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# DataError: new encoding (UTF8) is incompatible with the encoding of the
|
||||||
|
# template database (SQL_ASCII) HINT: Use the same encoding as in the template
|
||||||
|
# database, or use template0 as template.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
db_template = template0
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Master Database password
|
||||||
|
# This is set at first boot, and can be set from within Odoo
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
admin_passwd = 12357
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# specify the the maximum number of physical connections to posgresql
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
db_maxconn = 64
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Filter listed database REGEXP
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
dbfilter = .*
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
||||||
|
# Logs Settings
|
||||||
|
#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# I found information from Odoo on logging was not very clear. So I complied
|
||||||
|
# this helpful list and info about Odoo logging.
|
||||||
|
#
|
||||||
|
# Information was gleaned from the following sites:
|
||||||
|
# (The URLs are broken up to fit them in the file)
|
||||||
|
# - http://www.mindissoftware.com
|
||||||
|
# /2014/09/07/Odoo-logging-configuration-usage-implementation/
|
||||||
|
# - https://www.odoo.com/
|
||||||
|
# /forum/help-1/question
|
||||||
|
# /what-is-the-full-list-of-command-line-options-for-odoo-59139
|
||||||
|
# - https://www.odoo.com/documentation/8.0/reference/cmdline.html
|
||||||
|
#
|
||||||
|
# Odoo uses the Python standard logging library. However, it uses a special
|
||||||
|
# configuration syntax to configure logging levels for its modules.
|
||||||
|
#
|
||||||
|
# It's helpful to know what each level type means, so below is quick list:
|
||||||
|
#
|
||||||
|
# Level meanings:
|
||||||
|
# debug: Debug message for debugging only.
|
||||||
|
# info: Information message to report important modular event.
|
||||||
|
# warning: Warning message to report minor issues.
|
||||||
|
# error: Error message to report failed operations.
|
||||||
|
# critical: A critical message -- so critical that the module cannot work
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# log_level:
|
||||||
|
# any value in the list below. Odoo changed the log_level meaning
|
||||||
|
# here because these level values are mapped to a set of predefined
|
||||||
|
# 'module:log_level' pairs. These pairs are listed next to the log-level.
|
||||||
|
# You could get the same result by using the log_handler option
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# LOG LEVEL / log_handler: module:log_level
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# info / [':INFO']
|
||||||
|
# critical / ['openerp:CRITICAL', 'werkzeug:CRITICAL']
|
||||||
|
# error / ['openerp:ERROR', 'werkzeug:ERROR']
|
||||||
|
# warn / ['openerp:WARNING', 'werkzeug:WARNING']
|
||||||
|
# debug / ['openerp:DEBUG']
|
||||||
|
# debug_sql / ['openerp.sql_db:DEBUG']
|
||||||
|
# debug_rpc / ['openerp:DEBUG','openerp.http.rpc.request:DEBUG']
|
||||||
|
# debug_rpc_answer / ['openerp:DEBUG','openerp.http.rpc.request:DEBUG',
|
||||||
|
# 'openerp.http.rpc.response:DEBUG']
|
||||||
|
#
|
||||||
|
# End of Logging Info
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# The log filename. If not set, use stdout.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
; logfile = /var/log/odoo/openerp-server.log
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# True/False. If True, create a daily log file and keep 30 files.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
; logrotate = True
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Ture/False. If True, also write log to 'ir_logging' table in database
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
log-db = True
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# True/False logs to the system's event logger: syslog
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
syslog = False
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Log level - One of the following:
|
||||||
|
# info, debug_rpc, warn, test, critical, debug_sql, error, debug,
|
||||||
|
# debug_rpc_answer
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
log-level = warn
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# log_handler - can be a list of 'module:log_level' pairs.
|
||||||
|
# The default value is ':INFO' -- it means the default logging level
|
||||||
|
# is 'INFO' for all modules.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# log_handler =
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
||||||
|
# Service Settings
|
||||||
|
#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# The IP address on which the server will bind.
|
||||||
|
# If empty, it will bind on all interfaces (default empty).
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
; interface = localhost
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# The TCP port on which the server will listen (default 8069).
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
port = 8069
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Launch server over https instead of http (default False).
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
secure = False
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Set to True if you are deploying your App behind a proxy
|
||||||
|
# e.g. Apache using mod_proxy. --proxy_mode added, using Werkzeug ProxyFix class
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
proxy_mode = True
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Specify the addons_path folders ordered by priority
|
||||||
|
# addons_path=/first/path/,/second/path/
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
addons_path = /opt/openerp/odoo/addons,/home/myaddons
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# The file where the server pid will be stored (default False).
|
||||||
|
# We are letting the init script create the pid
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# pidfile = False
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# specify reference timezone for the server (e.g. Europe/Brussels)
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
timezone = False
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# specify the certificate file for the SSL connection
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
secure_cert_file = server.cert
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# specify the private key file for the SSL connection
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
secure_pkey_file = server.pkey
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# XML-RPC Secure Configuration (disabled if ssl is unavailable):
|
||||||
|
# xmlrpcs - Set to False to disable the XML-RPC Secure protocol
|
||||||
|
# xmlrpcs_interface - Specify the TCP IP address for the XML-RPC Secure
|
||||||
|
# protocol. The empty string binds to all interfaces.
|
||||||
|
# xmlrpcs_port - Specify the TCP port for the XML-RPC Secure protocol
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
xmlrpcs = True
|
||||||
|
xmlrpcs_interface = 127.0.0.1
|
||||||
|
xmlrpcs_port = 8071
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# XML-RPC Configuration:
|
||||||
|
# xmlrpc - Set to False to disable the XML-RPC protocol
|
||||||
|
# xmlrpc_interface - Specify the TCP IP address for the XML-RPC
|
||||||
|
# protocol. The empty string binds to all interfaces.
|
||||||
|
# xmlrpc_port - Specify the TCP port for the XML-RPC protocol
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
xmlrpc = True
|
||||||
|
xmlrpc_interface = 127.0.0.1
|
||||||
|
xmlrpc_port = 8069
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Long polling port:
|
||||||
|
# TCP port for long-polling connections in multiprocessing or gevent mode,
|
||||||
|
# defaults to 8072. Not used in default (threaded) mode.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
longpolling_port = 8072
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Use this for big data importation, if it crashes you will be able to continue
|
||||||
|
# at the current state. Provide a filename to store intermediate importation
|
||||||
|
# states.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
import_partial =
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Use the unaccent function provided by the database when available
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
unaccent = False
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# specify modules to export. Use in combination with --i18n-export
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
translate_modules = ['all']
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Comma-separated list of server-wide modules, default=web
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
server_wide_modules = None
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
||||||
|
# Email Settings
|
||||||
|
#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Specify the SMTP server for sending email (default localhost).
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
smtp_server = localhost
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Specify the SMTP user for sending email (default False).
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
smtp_user = False
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Specify the SMTP password for sending email (default False).
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
smtp_password = False
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# if True, SMTP connections will be encrypted with SSL (STARTTLS)
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
smtp_ssl = False
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Specify the SMTP email address for sending email
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
email_from = "TKL-Odoo-Server@example.com"
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Specify the SMTP port
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
smtp_port = 25
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
||||||
|
# Tuning Options
|
||||||
|
#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# A word on tuning your Odoo Server
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# A lot of time has gone in to testing this TKL appliance, and one thing we
|
||||||
|
# learned while testing was tuning. For all the why we chose these numbers you
|
||||||
|
# can take a look at he issues on GitHub (links at the botton of this article)
|
||||||
|
#
|
||||||
|
# Most of this text here was taken from the Memory Matrix Discussion
|
||||||
|
# https://github.com/DocCyblade/tkl-odoo/issues/49#issuecomment-148881166
|
||||||
|
#
|
||||||
|
# It is important to note that you can run Odoo in threaded mode by setting
|
||||||
|
# the workers option to 0 however there are some modules that won't work
|
||||||
|
# and you loose fine grain control of resource management.
|
||||||
|
#
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# the --workers is how many new process will be started to perform work or
|
||||||
|
# (answer requests) The workers have limits upon them set by the limit_xxxxx
|
||||||
|
# options here in the config file.
|
||||||
|
#
|
||||||
|
# The "limit_memory_soft" limit is the amount of ram that when a process
|
||||||
|
# goes over this limit after it is done with the request it is terminated
|
||||||
|
# and the memory it was using is freed. This amount goes for each process
|
||||||
|
#
|
||||||
|
# The hard limit is the amount of ram that if the process goes over it,
|
||||||
|
# it WILL terminate right then. (I don't think this is really correct
|
||||||
|
# because of the PDF issue we had and set this to 1.3 GB and never
|
||||||
|
# saw a process take this much. but if its below 1.3GB PDF are not created)
|
||||||
|
#
|
||||||
|
# The one we need to pay attention to is the limit_memory_soft.
|
||||||
|
# As these workers will stay alive and hold on to memory until that limit
|
||||||
|
# is reached. So if you have 5 workers and the soft limit is 256MB you could
|
||||||
|
# end up with 5 workers each taking 256MB that's 1.25GB of RAM that could
|
||||||
|
# be taken up. If you only had 1GB of ram you may need to dial back your
|
||||||
|
# workers or your soft limit.
|
||||||
|
#
|
||||||
|
# It's a balancing act of sorts, I am also not sure if keeping the
|
||||||
|
# workers at say 350 or 400 if there is some caching effect. Not sure
|
||||||
|
# why it's holding on to the memory.
|
||||||
|
#
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Hardware Matrix for recommended values:
|
||||||
|
# (Note these are for REAL hardware, Virtual Hardware has it's own
|
||||||
|
# issues that can arise with too many guest on a host with too many
|
||||||
|
# CPU cores etc, so remember that when looking at the chart below)
|
||||||
|
# (One other note that when I tested these, I did use VMware but
|
||||||
|
# no other VMs where competing for resources)
|
||||||
|
# (One last note, really. These numbers are to show the relationship
|
||||||
|
# between the config settings and hardware. We also assume you are running
|
||||||
|
# the database server on the same server. I know at some point in the
|
||||||
|
# higher numbers that this would not be the case. These are not numbers
|
||||||
|
# set in stone nor numbers gotten from Odoo. These are numbers I have
|
||||||
|
# come up with from the testing I have done. Real world examples if you
|
||||||
|
# have them would be great and these numbers can and should be updated!
|
||||||
|
#
|
||||||
|
# Heading | Description
|
||||||
|
# ------------------ | ---------------------------------------------------------
|
||||||
|
# CPUs | Number of CPU Cores not threads
|
||||||
|
# Physical | Physical memory, not virtual or swap
|
||||||
|
# workers | Number of workers specified in config file (workers = x)
|
||||||
|
# cron | Number of workers for cron jobs (max_cron_threads = xx)
|
||||||
|
# Mem Per | Memory in MB that is the max memory for request per worker
|
||||||
|
# Max Mem | Maximum amount that can be used by all workers
|
||||||
|
# limit_memory_soft | Number in bytes that you will use for this setting
|
||||||
|
#
|
||||||
|
# Note: Max Memory if notice is less than total memory this is on purpose. As
|
||||||
|
# workers process requests they can grow beyond the Mem Per limit so a
|
||||||
|
# server under heavy load could go past this amount. This is why there
|
||||||
|
# is "head room" built in.
|
||||||
|
#
|
||||||
|
# CPUs | Physical | workers | cron | Mem Per | Max Mem | limit_memory_soft
|
||||||
|
# ---- | -------- | ------- | ---- | ------- | ------- | -----------------------
|
||||||
|
# ANY | =< 256MB | NR | NR | NR | NR | NR
|
||||||
|
# 1 | 512MB | 0 | N/A | N/A | N/A | N/A
|
||||||
|
# 1 | 512MB | 1 | 1 | 177MB | 354MB | 185127901
|
||||||
|
# 1 | 1GB | 2 | 1 | 244MB | 732MB | 255652815
|
||||||
|
# 1 | 2GB | 2 | 1 | 506MB | 1518MB | 530242876
|
||||||
|
# 2 | 1GB | 3 | 1 | 183MB | 732MB | 191739611
|
||||||
|
# 2 | 2GB | 5 | 2 | 217MB | 1519MB | 227246947
|
||||||
|
# 2 | 4GB | 5 | 2 | 450MB | 3150MB | 471974428
|
||||||
|
# 4 | 2GB | 5 | 2 | 217MB | 1519MB | 227246947
|
||||||
|
# 4 | 4GB | 9 | 2 | 286MB | 3146MB | 300347363
|
||||||
|
# 4 | 8GB | 9 | 3 | 546MB | 6552MB | 572662306
|
||||||
|
# 4 | 16GB | 9 | 3 | 1187MB | 14244MB | 1244918057
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Calculations on how we got the above chart and other info can be found
|
||||||
|
#
|
||||||
|
# Memory Matrix Discussion
|
||||||
|
# https://github.com/DocCyblade/tkl-odoo/issues/49
|
||||||
|
#
|
||||||
|
# Shakedown Testing Discussions
|
||||||
|
# https://github.com/DocCyblade/tkl-odoo/issues/52
|
||||||
|
# https://github.com/DocCyblade/tkl-odoo/issues/53
|
||||||
|
# https://github.com/DocCyblade/tkl-odoo/issues/54
|
||||||
|
# https://github.com/DocCyblade/tkl-odoo/issues/55
|
||||||
|
#
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Specify the number of workers, 0 disable prefork mode.
|
||||||
|
# if count is not 0 , enables multiprocessing and sets up the
|
||||||
|
# specified number of HTTP workers (sub-processes processing HTTP and RPC
|
||||||
|
# requests). TKL Default is 0
|
||||||
|
#
|
||||||
|
# (See chart above for recommended values)
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
workers = 2
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# number of workers dedicated to cron jobs. Defaults to 2. The workers are
|
||||||
|
# threads in multithreading mode and processes in multiprocessing mode.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
max_cron_threads = 1
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Prevents the worker from using more than <limit> CPU seconds for each
|
||||||
|
# request. If the limit is exceeded, the worker is killed
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
limit_time_cpu = 60
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Prevents the worker from taking longer than <limit> seconds to process a
|
||||||
|
# request. If the limit is exceeded, the worker is killed.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
limit_time_real = 170
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Maximum allowed virtual memory per worker. If the limit is exceeded, the
|
||||||
|
# worker is killed and recycled at the end of the current request.
|
||||||
|
#
|
||||||
|
# (See chart above for recommended values)
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
limit_memory_soft = 255652815
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Hard limit on virtual memory, any worker exceeding the limit will be
|
||||||
|
# immediately killed without waiting for the end of the current request
|
||||||
|
# processing.
|
||||||
|
#
|
||||||
|
# Not sure of the reason but if this is set lower that 1.3GB then print jobs
|
||||||
|
# using PDF does not work. We are unsure why but this was the lowest amount
|
||||||
|
# for it to work.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
limit_memory_hard = 1395864371
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Number of requests a worker will process before being recycled and restarted.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
limit_request = 8196
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Force a limit on the maximum number of records kept in the virtual osv_memory
|
||||||
|
# tables. The default is False, which means no count-based limit.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
osv_memory_count_limit = False
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Force a limit on the maximum age of records kept in the virtual osv_memory
|
||||||
|
# tables. This is a decimal value expressed in hours, and the default is 1 hour.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
osv_memory_age_limit = 1.0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
||||||
|
# Testing and Demo Settings
|
||||||
|
#HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Enable YAML and unit tests.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
test_enable = False
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Launch a python or YML test file.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
test_file = False
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# If set, will save sample of all reports in this directory.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
test_report_directory = False
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Commit database changes performed by YAML or XML tests.
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
test_commit = False
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# disable loading demo data for modules to be installed (comma-separated, use
|
||||||
|
# "all" for all modules). Default is none
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
without_demo = all
|
||||||
39
docker/repo_manifest_gen_org_prefix_path.py
Executable file
39
docker/repo_manifest_gen_org_prefix_path.py
Executable file
|
|
@ -0,0 +1,39 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
|
||||||
|
from os import listdir
|
||||||
|
from os.path import isdir, join, abspath
|
||||||
|
|
||||||
|
|
||||||
|
import configparser
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(prog='Configure base dir for all addons')
|
||||||
|
|
||||||
|
parser.add_argument("addonsBaseDir", help="Path where addons are checkouted")
|
||||||
|
parser.add_argument("srcConfigPath", help="Path where we retreive source config file to adapt with new addons path")
|
||||||
|
parser.add_argument("dstConfigPath", help="Path to save adapted cpnfiguration")
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
addonsBaseDir = args.addonsBaseDir
|
||||||
|
srcConfigPath = args.srcConfigPath
|
||||||
|
dstConfigPath = args.dstConfigPath
|
||||||
|
|
||||||
|
addonsDirs = [ abspath(join(addonsBaseDir, f)) for f in listdir(addonsBaseDir) if isdir(join(addonsBaseDir, f))]
|
||||||
|
|
||||||
|
# addonsDirs.insert(0, "/usr/lib/python3/dist-packages/odoo/addons/")
|
||||||
|
addonsDirs.insert(0, "/ERPLibre/odoo/addons/")
|
||||||
|
|
||||||
|
config = configparser.ConfigParser()
|
||||||
|
|
||||||
|
config.read(srcConfigPath)
|
||||||
|
|
||||||
|
separator = ","
|
||||||
|
|
||||||
|
config.set('options', 'addons_path', separator.join(addonsDirs))
|
||||||
|
|
||||||
|
print(config.get('options', 'addons_path' ))
|
||||||
|
|
||||||
|
with open(dstConfigPath, 'w') as configfile:
|
||||||
|
config.write(configfile)
|
||||||
40
docker/wait-for-psql.py
Executable file
40
docker/wait-for-psql.py
Executable file
|
|
@ -0,0 +1,40 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
import argparse
|
||||||
|
import psycopg2
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
arg_parser = argparse.ArgumentParser()
|
||||||
|
arg_parser.add_argument('--db_host', required=True)
|
||||||
|
arg_parser.add_argument('--db_port', required=True)
|
||||||
|
arg_parser.add_argument('--db_user', required=True)
|
||||||
|
arg_parser.add_argument('--db_password', required=True)
|
||||||
|
# arg_parser.add_argument('--db_name', required=True)
|
||||||
|
arg_parser.add_argument('--timeout', type=int, default=10)
|
||||||
|
|
||||||
|
args = arg_parser.parse_args()
|
||||||
|
|
||||||
|
start_time = time.time()
|
||||||
|
print("Try connection to postgres...")
|
||||||
|
|
||||||
|
connected = False
|
||||||
|
error = ''
|
||||||
|
while ((time.time() - start_time) < args.timeout ) or connected is True:
|
||||||
|
try:
|
||||||
|
|
||||||
|
conn = psycopg2.connect(user=args.db_user, host=args.db_host, port=args.db_port, password=args.db_password, dbname="odoo")
|
||||||
|
|
||||||
|
break
|
||||||
|
except psycopg2.OperationalError as e:
|
||||||
|
error = e
|
||||||
|
else:
|
||||||
|
connected = True
|
||||||
|
conn.close()
|
||||||
|
print(".")
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
|
if error:
|
||||||
|
print("Database connection failure: %s" % error, file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
Loading…
Reference in a new issue