-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
101 lines (82 loc) · 2.55 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
FROM ubuntu:jammy
# Maintainer information
# MAINTAINER mostafa <[email protected]>
# Use bash with pipefail for better error handling
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]
# Set locale to UTF-8
ENV LANG=C.UTF-8
# Set non-interactive mode for tzdata to avoid prompts during installation
ENV DEBIAN_FRONTEND=noninteractive
# Install necessary system dependencies and PostgreSQL client
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
tzdata \
dirmngr \
fonts-noto-cjk \
gnupg \
libssl-dev \
node-less \
npm \
python3-num2words \
python3-pip \
python3-phonenumbers \
python3-pyldap \
python3-qrcode \
python3-renderpm \
python3-setuptools \
python3-slugify \
python3-vobject \
python3-watchdog \
python3-xlrd \
python3-xlwt \
python3-wheel \
xz-utils \
build-essential \
autoconf \
libtool \
pkg-config \
python3-dev \
libldap2-dev \
libsasl2-dev \
postgresql-client \
libpq-dev \
wkhtmltopdf \
&& ln -fs /usr/share/zoneinfo/Europe/Istanbul /etc/localtime \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Install rtlcss globally
RUN npm install -g rtlcss
# Copy Odoo files to /opt/odoo directory
COPY ./odoo-18.0.post20241005 /opt/odoo
# Add the odoo user
RUN useradd -m odoo && echo odoo:odoo | chpasswd
# Upgrade pip and install Python dependencies for Odoo
RUN pip3 install --upgrade pip \
&& pip3 install wheel psycopg2-binary \
&& pip3 install -r /opt/odoo/requirements.txt
# Set up the Odoo binary
RUN cp /opt/odoo/setup/odoo /opt/odoo/odoo-bin && chmod +x /opt/odoo/odoo-bin
# Copy entrypoint and configuration files
COPY ./entrypoint.sh /
COPY ./odoo.conf /etc/odoo/
# Set permissions and prepare directories for Odoo
RUN chown odoo /etc/odoo/odoo.conf \
&& mkdir -p /mnt/extra-addons /var/lib/odoo \
&& chown -R odoo /mnt/extra-addons /var/lib/odoo
# Set volumes for Odoo
VOLUME ["/var/lib/odoo", "/mnt/extra-addons"]
# Expose Odoo services
EXPOSE 8069 8071 8072
# Set the default config file
ENV ODOO_RC=/etc/odoo/odoo.conf
# Copy wait-for-psql.py script and install additional Python dependencies
COPY wait-for-psql.py /usr/local/bin/wait-for-psql.py
RUN pip3 install simplejson
# Copy additional addons source
COPY ./addon_source /opt/addons
# Set default user to 'odoo'
USER odoo
# Entrypoint and CMD
ENTRYPOINT ["/entrypoint.sh"]
CMD ["odoo"]