Beautify changes by @revant (#20)

* feat: add gevent to worker image

* feat: real_ip configuration for nginx

* Return `healthcheck.sh` just for tests

Co-authored-by: Lev Vereshchagin <mail@vrslev.com>
This commit is contained in:
Revant Nandgaonkar
2022-02-20 21:29:26 +05:30
committed by GitHub
parent 3e424fb522
commit c2d57c8ce0
7 changed files with 43 additions and 11 deletions

View File

@@ -16,7 +16,7 @@ WORKDIR /home/frappe/frappe-bench
RUN pip install --no-cache-dir -U pip wheel \
&& python -m venv env \
&& env/bin/pip install --no-cache-dir -U pip wheel
&& env/bin/pip install --no-cache-dir -U pip wheel gevent
USER root
@@ -85,7 +85,7 @@ RUN apt-get update \
xvfb \
libfontconfig \
wkhtmltopdf \
# For healthcheck.sh in helm chart
# For healthcheck
wait-for-it \
jq \
# other
@@ -95,8 +95,8 @@ USER frappe
COPY pretend-bench.sh /usr/local/bin/bench
COPY push_backup.py /usr/local/bin/push-backup
# healthcheck.sh used in helm chart
COPY configure.py patched_bench_helper.py healthcheck.sh /usr/local/bin/
COPY configure.py patched_bench_helper.py /usr/local/bin/
COPY gevent_patch.py /opt/patches/
WORKDIR /home/frappe/frappe-bench/sites

View File

@@ -0,0 +1,3 @@
import gevent.monkey
gevent.monkey.patch_all()

View File

@@ -1,28 +0,0 @@
#!/bin/bash
set -e
get_key() {
jq -r ".$1" /home/frappe/frappe-bench/sites/common_site_config.json
}
get_redis_url() {
URL=$(get_key "$1" | sed 's|redis://||g')
if [[ ${URL} == *"/"* ]]; then
URL=$(echo "${URL}" | cut -f1 -d"/")
fi
echo "$URL"
}
check_connection() {
echo "Check $1"
wait-for-it "$1" -t 1
}
check_connection "$(get_key db_host):$(get_key db_port)"
check_connection "$(get_redis_url redis_cache)"
check_connection "$(get_redis_url redis_queue)"
check_connection "$(get_redis_url redis_socketio)"
if [[ "$1" = -p || "$1" = --ping-service ]]; then
check_connection "$2"
fi