-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
73 lines (65 loc) · 2.37 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
FROM python:2.7.17-slim-stretch
MAINTAINER Hibou Corp. <[email protected]>
COPY --chown=104 requirements.txt requirements-hibou.txt /opt/odoo/odoo/
RUN set -x; \
# Add Odoo User
useradd -m -d /var/lib/odoo -s /bin/false -u 104 -g 33 odoo \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
zip \
curl \
vim \
# for apt-key
gnupg \
# for pip install \
gcc g++ \
libcurl4-openssl-dev libsasl2-dev libldap2-dev libssl-dev libyaml-dev \
# pillow
libjpeg-dev zlib1g-dev \
# install postgresql-client from postgres itself to support newer server versions
&& curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" >> /etc/apt/sources.list.d/pgdg.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
postgresql-client \
# install Python Requirements
&& pip install -r /opt/odoo/odoo/requirements.txt \
&& pip install -r /opt/odoo/odoo/requirements-hibou.txt \
# install wkhtmltox
&& cd /tmp \
&& 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 - \
&& dpkg --force-depends -i wkhtmltox.deb \
&& rm -rf wkhtmltox.deb \
# Clean Up
&& rm -rf /root/.cache \
&& apt --fix-broken -y install \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
;
# install newer node and lessc (mostly for less compatibility)
RUN set -x; \
curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g less \
;
# Prime the uszipcode cache.
# not working 2022-08-03
# USER 104
# RUN python -c 'import uszipcode; uszipcode.SearchEngine().by_zipcode('98270');'
USER 0
COPY --chown=104 . /opt/odoo/odoo
RUN set -x; \
cd /opt/odoo/odoo \
&& python setup.py install \
&& mv /opt/odoo/odoo/entrypoint.sh /entrypoint.sh \
&& mkdir -p /etc/odoo/ \
&& chown -R odoo /etc/odoo \
&& cp /opt/odoo/odoo/debian/odoo.conf /etc/odoo/odoo.conf \
;
VOLUME ["/var/lib/odoo"]
EXPOSE 8069 8072
ENV ODOO_RC /etc/odoo/odoo.conf
USER odoo
ENTRYPOINT ["/entrypoint.sh"]
CMD ["odoo"]