Skip to content

Commit

Permalink
New Dockerfile & instance: Flower
Browse files Browse the repository at this point in the history
The flower container image can be used
to analyze and manage celery tasks.
  • Loading branch information
softdevm committed Feb 10, 2021
1 parent c82da7f commit f18c719
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,19 @@ services:
- cachito-api
- nexus
- rabbitmq

flower:
build:
context: .
dockerfile: ./docker/Dockerfile-flower
entrypoint:
- /usr/local/bin/flower-waits-for-cachito.sh
- http://cachito-api:8080
command:
- /usr/local/bin/flower
- --port=5555
- --broker=amqp://cachito:cachito@rabbitmq:5672//
- --broker_api=http://cachito:cachito@rabbitmq:15672/api/
- --basic_auth=cachito:cachito
ports:
- 8083:5555
11 changes: 11 additions & 0 deletions docker/Dockerfile-flower
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM registry.fedoraproject.org/fedora:33
LABEL maintainer="Red Hat"

RUN dnf -y install \
--setopt=deltarpm=0 \
--setopt=install_weak_deps=false \
--setopt=tsflags=nodocs \
python3-pip
RUN pip3 install flower==0.9.7

COPY ./docker/flower-waits-for-cachito.sh /usr/local/bin/
14 changes: 14 additions & 0 deletions docker/flower-waits-for-cachito.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
set -eu

cachito_api=$1
shift

until curl --fail --silent --show-error "${cachito_api}/api/v1/status/short"; do
echo "Cachito is unavailable - sleeping"
sleep 3
done

echo "Cachito is up - proceeding"

exec "$@"

0 comments on commit f18c719

Please sign in to comment.