Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker – "flower": executable file not found in $PATH: unknown

Tags:

docker

flower

I'm trying to build a Docker file. It goes all well up until the end, when I get the error message:

ERROR: for flower Cannot start service flower: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "flower": executable file not found in $PATH: unknown

The corresponding compose.yml:

version: "3.9"

services:
  app: &app
    image: registry.gitlab.inria.fr/scripta/escriptorium/app
    build:
      context: .
    env_file: variables.env
    volumes:
      # - ./app/:/usr/src/app/
      - static:/usr/src/app/static
      - media:/usr/src/app/media
    command: /bin/true

  web:
    <<: *app
    command: uwsgi --ini /usr/src/app/uwsgi.ini
    expose:
      - 8000

  channelserver:
    <<: *app
    command: daphne --bind 0.0.0.0 --port 5000 -v 1 escriptorium.asgi:application
    expose:
      - 5000

  db:
    image: postgres:10.5-alpine
    volumes:
      - postgres:/var/lib/postgresql/data/
    env_file: variables.env

  redis:
    image: sickp/alpine-redis:4.0.6

  nginx:
    image: registry.gitlab.inria.fr/scripta/escriptorium/nginx
    build: ./nginx
    environment:
      - SERVERNAME=${DOMAIN:-localhost}
    volumes:
      - type: bind
        source: $PWD/nginx/nginx.conf
        target: /etc/nginx/conf.d/nginx.conf
      - static:/usr/src/app/static
      - media:/usr/src/app/media
    ports:
      - 8080:80

  celery-main:
    <<: *app
    environment:
      - OMP_NUM_THREADS=1
    command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q default -c ${CELERY_MAIN_CONC:-10} --max-tasks-per-child=10"

  celery-live:
    <<: *app
    command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q live -c ${CELERY_LIVE_CONC:-10} --max-tasks-per-child=10"

  celery-low-priority:
    <<: *app
    command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q low-priority -c ${CELERY_LOW_CONC:-10} --max-tasks-per-child=10"

  celery-gpu: &celery-gpu
    <<: *app
    environment:
      - KRAKEN_TRAINING_DEVICE=cpu
    command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q gpu -c 1 --max-tasks-per-child=1"
    shm_size: '3gb'

  flower:
    image: mher/flower
    command: ["flower", "--broker=redis://redis:6379/0", "--port=5555"]
    ports:
      - 5555:5555

  mail:
    build: ./exim
    image: registry.gitlab.inria.fr/scripta/escriptorium/mail
    expose:
      - 25
    environment:
      - PRIMARY_HOST=${DOMAIN:-localhost}
      - ALLOWED_HOSTS=web ; celery-main ; celery-low-priority; docker0

volumes:
   static:
   media:
   postgres:
   esdata:
like image 683
MaxMirandola Avatar asked Jul 06 '21 09:07

MaxMirandola


Video Answer


2 Answers

You need to run celery --broker=redis://redis:6379/0 flower --port=5555

Following is from flower official docs

From version 1.0.1 Flower uses Celery 5 and has to be invoked in the same style as celery commands do.

You can also put celery specific arguments follow this template.

celery [celery args] flower [flower args]

like image 126
user_gautam Avatar answered Oct 19 '22 08:10

user_gautam


The following link is a great article on this: https://www.distributedpython.com/2018/10/13/flower-docker/

Essentially, replace "command" with the following:

  environment:
    - CELERY_BROKER_URL=redis://redis:6379/0
    - FLOWER_PORT=5555
like image 35
David W. Avatar answered Oct 19 '22 07:10

David W.