Skip to content

Commit a7e2eb4

Browse files
committed
[ADD] Odoo: 12.0
* Creation of Dockerfile for Odoo version 12.0 release 20181004
1 parent e34689b commit a7e2eb4

File tree

3 files changed

+138
-0
lines changed

3 files changed

+138
-0
lines changed

12.0/Dockerfile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
FROM debian:stretch
2+
MAINTAINER Odoo S.A. <[email protected]>
3+
4+
# Generate locale C.UTF-8 for postgres and general locale data
5+
ENV LANG C.UTF-8
6+
7+
# Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf
8+
RUN set -x; \
9+
apt-get update \
10+
&& apt-get install -y --no-install-recommends \
11+
ca-certificates \
12+
curl \
13+
node-less \
14+
python3-pip \
15+
python3-setuptools \
16+
python3-renderpm \
17+
libssl1.0-dev \
18+
xz-utils \
19+
python3-watchdog \
20+
&& curl -o wkhtmltox.tar.xz -SL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz \
21+
&& echo '3f923f425d345940089e44c1466f6408b9619562 wkhtmltox.tar.xz' | sha1sum -c - \
22+
&& tar xvf wkhtmltox.tar.xz \
23+
&& cp wkhtmltox/lib/* /usr/local/lib/ \
24+
&& cp wkhtmltox/bin/* /usr/local/bin/ \
25+
&& cp -r wkhtmltox/share/man/man1 /usr/local/share/man/
26+
27+
# Install Odoo
28+
ENV ODOO_VERSION 12.0
29+
ENV ODOO_RELEASE 20181004
30+
RUN set -x; \
31+
curl -o odoo.deb -SL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \
32+
&& echo '3c8718416df355bc823a0c1cb4af6b8141183a3b odoo.deb' | sha1sum -c - \
33+
&& dpkg --force-depends -i odoo.deb \
34+
&& apt-get update \
35+
&& apt-get -y install -f --no-install-recommends \
36+
&& rm -rf /var/lib/apt/lists/* odoo.deb
37+
38+
# Copy entrypoint script and Odoo configuration file
39+
RUN pip3 install num2words xlwt
40+
COPY ./entrypoint.sh /
41+
COPY ./odoo.conf /etc/odoo/
42+
RUN chown odoo /etc/odoo/odoo.conf
43+
44+
# Mount /var/lib/odoo to allow restoring filestore and /mnt/extra-addons for users addons
45+
RUN mkdir -p /mnt/extra-addons \
46+
&& chown -R odoo /mnt/extra-addons
47+
VOLUME ["/var/lib/odoo", "/mnt/extra-addons"]
48+
49+
# Expose Odoo services
50+
EXPOSE 8069 8071
51+
52+
# Set the default config file
53+
ENV ODOO_RC /etc/odoo/odoo.conf
54+
55+
# Set default user when running the container
56+
USER odoo
57+
58+
ENTRYPOINT ["/entrypoint.sh"]
59+
CMD ["odoo"]

12.0/entrypoint.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# set the postgres database host, port, user and password according to the environment
6+
# and pass them as arguments to the odoo process if not present in the config file
7+
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}
8+
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
9+
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
10+
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
11+
12+
DB_ARGS=()
13+
function check_config() {
14+
param="$1"
15+
value="$2"
16+
if ! grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then
17+
DB_ARGS+=("--${param}")
18+
DB_ARGS+=("${value}")
19+
fi;
20+
}
21+
check_config "db_host" "$HOST"
22+
check_config "db_port" "$PORT"
23+
check_config "db_user" "$USER"
24+
check_config "db_password" "$PASSWORD"
25+
26+
case "$1" in
27+
-- | odoo)
28+
shift
29+
if [[ "$1" == "scaffold" ]] ; then
30+
exec odoo "$@"
31+
else
32+
exec odoo "$@" "${DB_ARGS[@]}"
33+
fi
34+
;;
35+
-*)
36+
exec odoo "$@" "${DB_ARGS[@]}"
37+
;;
38+
*)
39+
exec "$@"
40+
esac
41+
42+
exit 1

12.0/odoo.conf

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[options]
2+
addons_path = /mnt/extra-addons
3+
data_dir = /var/lib/odoo
4+
; admin_passwd = admin
5+
; csv_internal_sep = ,
6+
; db_maxconn = 64
7+
; db_name = False
8+
; db_template = template1
9+
; dbfilter = .*
10+
; debug_mode = False
11+
; email_from = False
12+
; limit_memory_hard = 2684354560
13+
; limit_memory_soft = 2147483648
14+
; limit_request = 8192
15+
; limit_time_cpu = 60
16+
; limit_time_real = 120
17+
; list_db = True
18+
; log_db = False
19+
; log_handler = [':INFO']
20+
; log_level = info
21+
; logfile = None
22+
; longpolling_port = 8072
23+
; max_cron_threads = 2
24+
; osv_memory_age_limit = 1.0
25+
; osv_memory_count_limit = False
26+
; smtp_password = False
27+
; smtp_port = 25
28+
; smtp_server = localhost
29+
; smtp_ssl = False
30+
; smtp_user = False
31+
; workers = 0
32+
; xmlrpc = True
33+
; xmlrpc_interface =
34+
; xmlrpc_port = 8069
35+
; xmlrpcs = True
36+
; xmlrpcs_interface =
37+
; xmlrpcs_port = 8071

0 commit comments

Comments
 (0)