tobymao / saq

Simple Async Queues

Home Page:https://saq-py.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use Saq Web in docker

albcunha opened this issue · comments

I´m trying to open saq dashboard on docker.
I´m using de the config from a starlite template (https://github.com/starlite-api/starlite-pg-redis-docker).

Here is the the docker compose, with some changes:
version: "3.9"
services:
  redis:
    image: redis:latest
    ports:
      - "6379:6379"
    volumes:
      - cache:/data

  db:
    image: postgres:latest
    volumes:
      - db:/var/lib/postrgresql/data/
    ports:
      - "5432:5432"
    environment:
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: postgres

  mailhog:
    image: mailhog/mailhog
    ports:
      - "1025:1025"
      - "8025:8025"

  app:
    image: test/starlite:1.0
    build:
      context: .
      target: install
      args:
        INSTALL_ARGS: "--no-root"
    command: scripts/entry
    depends_on:
      - db
      - mailhog
      - redis
    ports:
      - "8000:8000"
      
    env_file:
      - .env
    volumes:
      - .:/app:cached
   saq:
    image: test/starlite:1.0
    command: python -m saq --web app.lib.workers
    ports:
      - "8080:8080"
    
        
volumes:
  db: {}
  cache: {}

It doesn´t work if I try call the worker with lib.worker or app.app.lib.worker.
Do you have any suggestion how to call the web interface on this situation?

you need to make sure that your worker is in your python path.

so you could export PYTHONPATH=$PYTHONPATH:/path_to_app

without an error message, i'm not sure i can help more, but this is my guess