[FIX] Odoo 11.0-12.0: replace wait-for-it script

As the wait-for-it script is started before the parsing of the command
line, it is always started. It can be a problem if a user wants to start
some other binary than odoo (for example a shell).

Also, the wait-for-it script is only checking if a port is open on a
host and then waits 5 seconds before starting Odoo.

With this commit, the wait-for-it script is replaced by a more useful
custom python script that checks if the postgresql server is able to
handle a connection with the given parameters. Odoo then starts whenever
it's ready or fails after a 30 sec timeout.
This commit is contained in:
Christophe Monniez
2019-10-23 15:35:01 +02:00
parent 19c6725881
commit ffe62bdd52
9 changed files with 108 additions and 12 deletions
+2 -1
View File
@@ -13,7 +13,6 @@ RUN set -x; \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
wait-for-it \
dirmngr \
fonts-noto-cjk \
gnupg \
@@ -90,6 +89,8 @@ EXPOSE 8069 8071
# Set the default config file
ENV ODOO_RC /etc/odoo/odoo.conf
COPY wait-for-psql.py /usr/local/bin/wait-for-psql.py
# Set default user when running the container
USER odoo