From f18c719a0b5da38be75c2d5457c4ff3b775d53e5 Mon Sep 17 00:00:00 2001 From: softdevm Date: Wed, 27 Jan 2021 12:51:11 +0100 Subject: [PATCH] New Dockerfile & instance: Flower The flower container image can be used to analyze and manage celery tasks. --- docker-compose.yml | 16 ++++++++++++++++ docker/Dockerfile-flower | 11 +++++++++++ docker/flower-waits-for-cachito.sh | 14 ++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 docker/Dockerfile-flower create mode 100755 docker/flower-waits-for-cachito.sh diff --git a/docker-compose.yml b/docker-compose.yml index 849d885..d286877 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/docker/Dockerfile-flower b/docker/Dockerfile-flower new file mode 100644 index 0000000..992fb03 --- /dev/null +++ b/docker/Dockerfile-flower @@ -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/ diff --git a/docker/flower-waits-for-cachito.sh b/docker/flower-waits-for-cachito.sh new file mode 100755 index 0000000..5108357 --- /dev/null +++ b/docker/flower-waits-for-cachito.sh @@ -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 "$@"