mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-11-10 07:11:00 +00:00
Merge pull request #348 from revant/fix-healthcheck
This commit is contained in:
commit
a3ed6b8403
29
build/common/worker/healthcheck.sh
Executable file
29
build/common/worker/healthcheck.sh
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
export COMMON_SITE_CONFIG_JSON='/home/frappe/frappe-bench/sites/common_site_config.json'
|
||||||
|
|
||||||
|
# Set DB Host and port
|
||||||
|
export DB_HOST=`cat $COMMON_SITE_CONFIG_JSON | awk '/db_host/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n'`
|
||||||
|
export DB_PORT=`cat $COMMON_SITE_CONFIG_JSON | awk '/db_port/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n'`
|
||||||
|
if [[ -z "$DB_PORT" ]]; then
|
||||||
|
export DB_PORT=3306
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set REDIS host:port
|
||||||
|
export REDIS_CACHE=`cat $COMMON_SITE_CONFIG_JSON | awk '/redis_cache/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n' | sed 's|redis://||g'`
|
||||||
|
export REDIS_QUEUE=`cat $COMMON_SITE_CONFIG_JSON | awk '/redis_queue/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n' | sed 's|redis://||g'`
|
||||||
|
export REDIS_SOCKETIO=`cat $COMMON_SITE_CONFIG_JSON | awk '/redis_socketio/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n' | sed 's|redis://||g'`
|
||||||
|
|
||||||
|
echo "Check $DB_HOST:$DB_PORT"
|
||||||
|
wait-for-it $DB_HOST:$DB_PORT -t 1
|
||||||
|
echo "Check $REDIS_CACHE"
|
||||||
|
wait-for-it $REDIS_CACHE -t 1
|
||||||
|
echo "Check $REDIS_QUEUE"
|
||||||
|
wait-for-it $REDIS_QUEUE -t 1
|
||||||
|
echo "Check $REDIS_SOCKETIO"
|
||||||
|
wait-for-it $REDIS_SOCKETIO -t 1
|
||||||
|
|
||||||
|
if [[ "$1" = "-p" ]] || [[ "$1" = "--ping-service" ]]; then
|
||||||
|
echo "Check $2"
|
||||||
|
wait-for-it $2 -t 1
|
||||||
|
fi
|
@ -28,6 +28,7 @@ RUN install_packages \
|
|||||||
xfonts-base \
|
xfonts-base \
|
||||||
# For psycopg2
|
# For psycopg2
|
||||||
libpq-dev \
|
libpq-dev \
|
||||||
|
wait-for-it \
|
||||||
&& wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.buster_amd64.deb \
|
&& wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.buster_amd64.deb \
|
||||||
&& dpkg -i wkhtmltox_0.12.5-1.buster_amd64.deb && rm wkhtmltox_0.12.5-1.buster_amd64.deb \
|
&& dpkg -i wkhtmltox_0.12.5-1.buster_amd64.deb && rm wkhtmltox_0.12.5-1.buster_amd64.deb \
|
||||||
&& wget https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh \
|
&& wget https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh \
|
||||||
@ -58,6 +59,7 @@ COPY build/common/commands/* /home/frappe/frappe-bench/commands/
|
|||||||
COPY build/common/common_site_config.json.template /opt/frappe/common_site_config.json.template
|
COPY build/common/common_site_config.json.template /opt/frappe/common_site_config.json.template
|
||||||
COPY build/common/worker/install_app.sh /usr/local/bin/install_app
|
COPY build/common/worker/install_app.sh /usr/local/bin/install_app
|
||||||
COPY build/common/worker/bench /usr/local/bin/bench
|
COPY build/common/worker/bench /usr/local/bin/bench
|
||||||
|
COPY build/common/worker/healthcheck.sh /usr/local/bin/healthcheck.sh
|
||||||
|
|
||||||
# Setup docker-entrypoint
|
# Setup docker-entrypoint
|
||||||
COPY build/common/worker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
COPY build/common/worker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user