-
Notifications
You must be signed in to change notification settings - Fork 15
/
14.0.Dockerfile
163 lines (148 loc) · 4.86 KB
/
14.0.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
FROM python:3.8-slim-buster
EXPOSE 8069 8072
# Enable Odoo user and filestore
RUN useradd -md /home/odoo -s /bin/false odoo \
&& mkdir -p /var/lib/odoo \
&& chown -R odoo:odoo /var/lib/odoo \
&& sync
# System environment variables
ENV GIT_AUTHOR_NAME=docker-odoo \
GIT_COMMITTER_NAME=docker-odoo \
LC_ALL=C.UTF-8 \
NODE_PATH=/usr/local/lib/node_modules:/usr/lib/node_modules \
PATH="/home/odoo/.local/bin:$PATH" \
PIP_NO_CACHE_DIR=0 \
PYTHONOPTIMIZE=1
# Default values of env variables used by scripts
ENV ODOO_SERVER=odoo \
UNACCENT=True \
PROXY_MODE=True \
WITHOUT_DEMO=True \
WAIT_PG=true \
PGUSER=odoo \
PGPASSWORD=odoo \
PGHOST=db \
PGPORT=5432 \
ADMIN_PASSWORD=admin
# Other requirements and recommendations to run Odoo
# See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control
ARG WKHTMLTOPDF_VERSION=0.12.5
ARG WKHTMLTOPDF_CHECKSUM='1140b0ab02aa6e17346af2f14ed0de807376de475ba90e1db3975f112fbd20bb'
RUN apt-get -qq update \
&& apt-get install -yqq --no-install-recommends \
curl \
&& curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.stretch_amd64.deb \
&& echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \
&& apt-get install -yqq --no-install-recommends \
./wkhtmltox.deb \
chromium \
ffmpeg \
fonts-liberation2 \
gettext-base \
git \
gnupg2 \
locales-all \
nano \
npm \
wget \
openssh-client \
telnet \
vim \
zlibc \
sudo \
&& echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \
&& curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& apt-get update \
&& apt-get install -yqq --no-install-recommends postgresql-client \
&& apt-get autopurge -yqq \
&& rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \
&& sync
ARG ODOO_VERSION=14.0
ARG ODOO_SOURCE=odoo/odoo
ENV ODOO_VERSION="$ODOO_VERSION"
ENV ODOO_SOURCE="$ODOO_SOURCE"
# Install Odoo hard & soft dependencies, and Doodba utilities
RUN build_deps=" \
build-essential \
libfreetype6-dev \
libfribidi-dev \
libghc-zlib-dev \
libharfbuzz-dev \
libjpeg-dev \
liblcms2-dev \
libldap2-dev \
libopenjp2-7-dev \
libpq-dev \
libsasl2-dev \
libtiff5-dev \
libwebp-dev \
libxml2-dev \
libxslt-dev \
tcl-dev \
tk-dev \
zlib1g-dev \
" \
&& apt-get update \
&& apt-get install -yqq --no-install-recommends $build_deps \
&& pip install --no-cache-dir \
-r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \
git-aggregator \
ipython \
pysnooper \
ipdb \
git+git://github.com/OCA/openupgradelib.git \
click-odoo-contrib \
geoip2 \
pg_activity \
phonenumbers \
&& (python3 -m compileall -q /usr/local/lib/python3.8/ || true) \
&& apt-get purge -yqq $build_deps \
&& apt-get autopurge -yqq \
&& rm -Rf /var/lib/apt/lists/* /tmp/*
# Metadata
ARG VCS_REF
ARG BUILD_DATE
ARG VERSION
LABEL org.label-schema.schema-version="$VERSION" \
org.label-schema.vendor=Adhoc \
org.label-schema.license=Apache-2.0 \
org.label-schema.build-date="$BUILD_DATE" \
org.label-schema.vcs-ref="$VCS_REF" \
org.label-schema.vcs-url="https://github.com/ingadhoc/docker-odoo"
# Create directory structure
ENV SOURCES /home/odoo/src
ENV CUSTOM /home/odoo/custom
ENV RESOURCES /home/odoo/.resources
ENV CONFIG_DIR /home/odoo/.config
ENV DATA_DIR /home/odoo/data
ENV OPENERP_SERVER=$CONFIG_DIR/odoo.conf
ENV ODOO_RC=$OPENERP_SERVER
RUN mkdir -p $SOURCES/repositories && \
mkdir -p $CUSTOM/repositories && \
mkdir -p $DATA_DIR && \
mkdir -p $CONFIG_DIR && \
mkdir -p $RESOURCES && \
chown -R odoo.odoo /home/odoo && \
sync
# Usefull aliases
RUN echo "alias odoo-shell='odoo shell --shell-interface ipython --no-http --limit-memory-hard=0 --limit-memory-soft=0'" >> /home/odoo/.bashrc
# Image building scripts
COPY bin/* /usr/local/bin/
COPY build.d $RESOURCES/build.d
COPY conf.d $RESOURCES/conf.d
COPY entrypoint.d $RESOURCES/entrypoint.d
COPY entrypoint.sh $RESOURCES/entrypoint.sh
COPY resources/* $RESOURCES/
RUN ln /usr/local/bin/direxec $RESOURCES/entrypoint \
&& ln /usr/local/bin/direxec $RESOURCES/build \
&& chown -R odoo.odoo $RESOURCES \
&& chmod -R a+rx $RESOURCES/entrypoint* $RESOURCES/build* /usr/local/bin \
&& sync
# Run build scripts
RUN $RESOURCES/build && sync
# Entrypoint
WORKDIR "/home/odoo"
ENTRYPOINT ["/home/odoo/.resources/entrypoint.sh"]
CMD ["odoo"]
USER odoo