Adds simple Python to wait for Redis broker to be ready (with minor Dockerfile improvements)

This commit is contained in:
Trenton Holmes 2022-04-23 14:40:56 -07:00 committed by Trenton Holmes
parent f9194bd28c
commit 2407798d2e
3 changed files with 54 additions and 0 deletions

View file

@ -27,6 +27,14 @@ wait_for_postgres() {
done
}
wait_for_redis() {
# We use a Python script to send the Redis ping
# instead of installing redis-tools just for 1 thing
if ! python3 /sbin/wait-for-redis.py; then
exit 1
fi
}
migrations() {
(
# flock is in place to prevent multiple containers from doing migrations
@ -60,6 +68,8 @@ do_work() {
wait_for_postgres
fi
wait_for_redis
migrations
search_index