[ADD]Odoo base image for Yaltik

This commit is contained in:
Fabien Bourgeois 2016-09-30 15:02:46 +02:00
parent 5c8cfae671
commit 2810d27804
3 changed files with 120 additions and 0 deletions

61
odoo/odoo/Dockerfile Normal file
View File

@ -0,0 +1,61 @@
FROM debian:jessie
MAINTAINER Yaltik - Fabien Bourgeois <fabien@yaltik.com>
# 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 8.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
# Post-install tasks
RUN touch odoo.conf
RUN chown -R odoo .
# Volumes : data dir for filestore and addons
VOLUME "/opt/odoo/data"
# Odoo default ports
EXPOSE 8069 8071
COPY ./launch ./
# Default user : odoo
USER odoo
CMD [ "bash", "launch" ]

17
odoo/odoo/README.md Normal file
View File

@ -0,0 +1,17 @@
# Yaltik OCB Docker files
## Odoo - OCB
Simple Dockerfile by Yaltik.
It uses :
* Debian Jessie
* [OCB](https://github.com/OCA/OCB.git) fork, enjoying community fixes and is ATM focused around version *8.0*.
## Custom add-ons
You can propose a custom modules volume with : ...
## Compose
A compose file is proposed, with PostgreSQL 9.5 and Nginx proxy.

42
odoo/odoo/launch Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
# Small program, inspired from Yajo's one : https://bitbucket.org/yajo/docker-odoo
# It generates configuration file and launch OCB Odoo
CONF=/opt/odoo/odoo.conf
ODOOCMD="python /opt/odoo/OCB/odoo.py --config $CONF"
ADDONS_PATH="/opt/odoo/OCB/addons,/opt/odoo/data/addons"
cd extra-addons
for d in */ ; do
if ! [ "$d" == "*/" ]; then
ADDONS_PATH="$ADDONS_PATH,/opt/odoo/extra-addons/$d"
fi
done
cd ../custom-addons
for d in */ ; do
if ! [ "$d" == "*/" ]; then
ADDONS_PATH="$ADDONS_PATH,/opt/odoo/custom-addons/$d"
fi
done
# Configuration generation
echo "
[options]
; Configuration file auto-generated
addons_path = $ADDONS_PATH
data_dir = /opt/odoo/data
db_host = $DB_PORT_5432_TCP_ADDR
db_port = $DB_PORT_5432_TCP_PORT
db_user = $POSTGRES_USER
db_password = $POSTGRES_PASSWORD
db_maxconn = ${DB_MAXCONN:=10}
list_db = ${LIST_DB:=True}
workers = ${WORKERS:=1}
limit_time_cpu = ${LIMIT_TIME_CPU:=60}
limit_time_real = ${LIMIT_TIME_REAL:=120}
admin_passwd = ${ADMIN_PASSWORD:=admin}" > $CONF
# Odoo launch
$ODOOCMD