-
Notifications
You must be signed in to change notification settings - Fork 47
/
Dockerfile
87 lines (69 loc) · 3.68 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
FROM odoo:8.0
USER root
RUN apt-get update || true && \
apt-get install -y python-matplotlib emacs-nox git net-tools tree python-pip python3-pip file nginx python-dev sudo htop locales locales-all wget fonts-dejavu && \
pip install gevent psycogreen && \
#update werkzeug to make phantomjs work. See http://odoo-development.readthedocs.io/en/latest/dev/tests/js.html#regular-phantom-js-tests
pip install werkzeug --upgrade && \
apt-get install -y npm python-lxml libxml2-dev libxslt1-dev && \
# Extra package for pylint-odoo plugin
npm install -g jshint
# install phantomjs (based on https://hub.docker.com/r/cmfatih/phantomjs/~/dockerfile/ )
ENV PHANTOMJS_VERSION 1.9.8
RUN \
apt-get install -y libfreetype6 libfontconfig && \
mkdir -p /srv/var && \
wget -q --no-check-certificate -O /tmp/phantomjs-$PHANTOMJS_VERSION.tar.gz https://github.com/ariya/phantomjs/archive/$PHANTOMJS_VERSION.tar.gz && \
tar -xzf /tmp/phantomjs-$PHANTOMJS_VERSION.tar.gz -C /tmp && \
rm -f /tmp/phantomjs-$PHANTOMJS_VERSION.tar.gz && \
mv /tmp/phantomjs-$PHANTOMJS_VERSION/ /srv/var/phantomjs && \
ln -s /srv/var/phantomjs/bin/phantomjs /usr/bin/phantomjs && \
git clone https://github.com/n1k0/casperjs.git /srv/var/casperjs && \
ln -s /srv/var/casperjs/bin/casperjs /usr/bin/casperjs && \
apt-get autoremove -y && \
apt-get clean all
# fix access issue with nginx
RUN touch /var/log/nginx/error.log && \
touch /var/log/nginx/access.log && \
chown odoo:odoo -R /var/log/nginx && \
chown odoo:odoo -R /var/lib/nginx/
# python3 support
# https://unix.stackexchange.com/questions/332641/how-to-install-python-3-6
RUN wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz && \
tar xvf Python-3.6.3.tgz && \
cd Python-3.6.3 && \
./configure --enable-optimizations && \
make -j8 && \
make altinstall && \
rm /usr/bin/python3 && \
ln -s /usr/local/bin/python3.6 /usr/bin/python3
RUN wget https://bootstrap.pypa.io/get-pip.py && \
python3 get-pip.py && \
pip --version && \
pip3 --version && \
rm get-pip.py
RUN apt-get install -y libldap2-dev libsasl2-dev libffi-dev libssl-dev python-pandas && \
pip3 install -r https://raw.githubusercontent.com/odoo/odoo/12.0/requirements.txt || true && \
pip3 install -r https://raw.githubusercontent.com/odoo/odoo/11.0/requirements.txt || true && \
pip install -r https://raw.githubusercontent.com/odoo/odoo/10.0/requirements.txt || true
ENV BUILD_DATE=2016_11_03
RUN git clone -b 8.0 https://github.com/it-projects-llc/runbot-addons.git /mnt/runbot-addons && \
pip install --upgrade pip setuptools && \
pip install --upgrade pylint && \
pip install --upgrade git+https://github.com/oca/pylint-odoo.git && \
git clone -b runbot-docker https://github.com/yelizariev/odoo-extra.git /mnt/odoo-extra
# grant access to work dir
RUN chown odoo:odoo -R /mnt/odoo-extra/runbot/static/
RUN true && \
# always close cron db connnections
sed -i "s/if len(db_names) > 1:/if True:/" /usr/lib/python2.7/dist-packages/openerp/service/server.py && \
# auto_reload
sed -i -e "s/auto_reload = True/; auto_reload = True/" /etc/odoo/openerp-server.conf && \
# limits:
sed -i -e "s/; limit_time_cpu.*/limit_time_cpu = 300/" /etc/odoo/openerp-server.conf && \
sed -i -e "s/; limit_time_real.*/limit_time_real = 600/" /etc/odoo/openerp-server.conf && \
# addons_path:
sed -i -e "s;addons_path.*;addons_path = /mnt/odoo-extra,/mnt/extra-addons,/mnt/runbot-addons,/usr/lib/python2.7/dist-packages/openerp/addons;" /etc/odoo/openerp-server.conf
VOLUME ["/mnt/odoo-extra", "/mnt/runbot-addons"]
CMD ["openerp-server", "--database=runbot", "--db-filter=^runbot$", "--workers=2"]
USER odoo