Beat and worker exec /srv/docker-celery-beat.sh: no such file or directory

23 Views Asked by At

We created a Dockerfile to run an app that uses worker and beat (celery)

this is the service configuration on the docker-compose

 worker:
        container_name: cdm-worker
        build:
            context: .
            dockerfile: docker/Dockerfile
        user: celery
        command: /srv/docker-celery-worker.sh
        volumes:
            - ./import/:/srv/import
            - ./app:/srv/app
            - ./static:/srv/static
            - ./media:/srv/media
        depends_on:
            - db
        env_file: ${ENV_FILE}
        restart: always

    beat:
        container_name: cdm-beat
        build:
            context: .
            dockerfile: docker/Dockerfile
        user: celery
        command: /srv/docker-celery-beat.sh
        volumes:
            - ./import/:/srv/import
            - ./app:/srv/app
        depends_on:
            - db
        env_file: ${ENV_FILE}
        restart: always

After building the docker container, I am getting an error

-2024-02-14 11:54:44 exec /srv/docker-celery-beat.sh: no such file or directory

-2024-02-14 11:54:43 exec /srv/docker-celery-worker.sh: no such file or directory

on both of these (beat and worker), and I also checked if the file exists and if it's inenter image description here the correct file path

what I have done so far was

  • tried to create a volume with the docker scripts on it
  • change command /srv/docker-celery-worker.sh to sh -c '/srv/docker-celery-worker.sh'
  • tried copying the /srv/docker-celery-worker.sh into my local host to check if the file exists

Though I got my app running I am still getting the same error and I am running out of ideas. I do hope someone can help me and point me in the right direction. Thank you in advance.

0

There are 0 best solutions below