-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
149 lines (131 loc) · 3.91 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
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
FROM debian:bullseye
ENV DEBIAN_FRONTEND=noninteractive
ARG ODOO_UID=3328
ARG ODOO_GID=3328
ARG ODOO_HOMEDIR=/var/lib/odoo
ENV ODOO_HOMEDIR=${ODOO_HOMEDIR}
ENV ODOO_DB=odoodb
ENV ODOO_CONF_FILE=${ODOO_HOMEDIR}/odoo.conf
ENV ODOO_UPD_FILE=${ODOO_HOMEDIR}/update.txt
ENV ODOO_REQ_FILE=${ODOO_HOMEDIR}/requirements.txt
ENV ODOO_ADMIN_PASSWD=Db4dm1nSup3rS3cr3tP4ssw0rD
ENV PYTHON_VERSION=3.8.16
ENV POSTGRES_HOST=db
ENV POSTGRES_USER=odoo
ENV POSTGRES_PASSWORD=Us3rP4ssw0rD
ENV PGDATABASE=${ODOO_DB}
ENV PGHOST=${POSTGRES_HOST}
ENV PGPASSWORD=${POSTGRES_PASSWORD}
ENV PGUSER=${POSTGRES_USER}
ENV LANG=it_IT.UTF-8
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update && apt-get -y --no-install-recommends install \
build-essential \
bzip2 \
ca-certificates \
curl \
default-jre \
geoip-database \
git \
gnupg \
libbz2-dev \
libffi-dev \
libgdbm-dev \
libgeoip1 \
libjpeg-dev \
libldap2-dev \
libmagic-dev \
libncurses5-dev \
libnss3-dev \
libpq-dev \
libreadline-dev \
libreoffice \
libreoffice-java-common \
libsasl2-dev \
libsqlite3-dev \
libssl-dev \
libwebp-dev \
libxml2-dev \
libxslt-dev \
libzip-dev \
locales \
lsb-release \
nano \
pg-activity \
procps \
rsync \
tdsodbc \
telnet \
unzip \
vim \
wget \
xsltproc \
zlib1g-dev && \
rm -rf /var/lib/apt/lists/*
RUN curl -L https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -o /tmp/Python-${PYTHON_VERSION}.tgz && \
cd /tmp/ && \
tar -xf /tmp/Python-${PYTHON_VERSION}.tgz && \
cd /tmp/Python-${PYTHON_VERSION} && \
./configure \
--enable-optimizations \
--enable-option-checking=fatal \
--enable-shared \
--prefix=/usr/local \
--with-lto && \
make -j4 && \
make altinstall && \
cd / && \
rm /tmp/Python-${PYTHON_VERSION}.tgz && \
rm -R /tmp/Python-${PYTHON_VERSION} && \
update-alternatives --install /usr/bin/python python /usr/local/bin/python${PYTHON_VERSION%.*} 1 && \
update-alternatives --install /usr/bin/pip pip /usr/local/bin/pip${PYTHON_VERSION%.*} 1
RUN apt-get update && \
curl -L https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.buster_amd64.deb -o /tmp/wkhtmltopdf.deb && \
apt-get -y install /tmp/wkhtmltopdf.deb && \
rm /tmp/wkhtmltopdf.deb && \
rm -rf /var/lib/apt/lists/*
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
apt-get update && \
apt-get -y install postgresql-client-14 && \
apt-get -y upgrade && \
rm -rf /var/lib/apt/lists/*
RUN echo "it_IT.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
RUN groupadd -g ${ODOO_GID} odoo && \
useradd -l -m -d ${ODOO_HOMEDIR} -s /bin/bash -u ${ODOO_UID} -g ${ODOO_GID} odoo && \
mkdir -p /etc/odoo && \
chown -R odoo:odoo /etc/odoo /opt
USER odoo
RUN git clone https://github.com/OCA/OCB.git --depth 1 --branch 14.0 --single-branch /opt/odoo
USER root
RUN python -m ensurepip --upgrade && \
python -m pip install --no-cache-dir --upgrade wheel && \
python -m pip install --no-cache-dir -r /opt/odoo/requirements.txt && \
python -m pip install --no-cache-dir /opt/odoo && \
python -m pip install --no-cache-dir \
escpos \
matplotlib \
odfpy \
openpyxl \
pandas \
pdf2image \
pdfkit \
pdfminer.six \
phonenumbers \
poppler-utils \
psycopg2-binary \
pudb \
pyopenssl \
pyotp \
python-magic \
scipy \
sqlalchemy==1.3.24 \
svglib \
Unidecode && \
python -m pip install --no-cache-dir git+https://github.com/OCA/openupgradelib.git@master
USER odoo
WORKDIR ${ODOO_HOMEDIR}
EXPOSE 8069 8071 8072
VOLUME ${ODOO_HOMEDIR}
COPY run.sh /run.sh
CMD /bin/bash /run.sh