Skip to content
Snippets Groups Projects
Verified Commit 176ce54b authored by Quentin Duchemin's avatar Quentin Duchemin
Browse files

[Etherpad] Automatic PG database creation and healthcheck in entrypoint

parent 98a64b39
No related branches found
No related tags found
No related merge requests found
Pipeline #61737 failed
......@@ -60,7 +60,7 @@ RUN useradd --uid ${UID} --create-home etherpad
COPY --from=downloader --chown=etherpad /opt/etherpad-lite /opt/etherpad-lite/
RUN apt-get update && \
apt-get install -y curl default-mysql-client && \
apt-get install -y curl default-mysql-client postgresql-client && \
chmod +x /opt/etherpad-lite/entrypoint.sh && \
usermod -d /opt/etherpad-lite etherpad && \
chown -R etherpad /opt/etherpad-lite && \
......
......@@ -22,7 +22,7 @@ if [ -z "${DB_HOST}" ]; then
exit 1
fi
while ! mysqladmin ping -u${DB_USER} -p${DB_PASSWORD} -h"${DB_HOST}" &>/dev/null; do
while ! { mysqladmin ping -u${DB_USER} -p${DB_PASSWORD} -h"${DB_HOST}" &>/dev/null || PGPASSWORD=${DB_PASSWORD} psql -h${DB_HOST} -U${DB_USER} -c "SELECT 1" }; do
echo "Database server not ready yet, re-trying in 5 seconds..."
sleep 5
done
......
POSTGRES_PASSWORD=password
POSTGRES_USER=etherpad
POSTGRES_DB=etherpad-lite
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment