diff --git a/README.md b/README.md index 6f98fb3..4b8120c 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ docker-compose up --build ## Tests To run the tests, use the `pytest` command ## Environment variables -`REDIS_URL` - optional, passed to Celery on initialization as a `broker` and `backend` argument, -default value is `redis://localhost:6379` +`KEYDB_URL` - optional, passed to Celery on initialization as a `broker` and `backend` argument, +default value is `redis://keydb:6379` `CLONE_DIR_PATH` - optional, specifies the path where the repositories will be cloned, default value is `./.repos/` diff --git a/compose.yaml b/compose.yaml index 6d56d10..abbe27d 100644 --- a/compose.yaml +++ b/compose.yaml @@ -3,24 +3,24 @@ services: build: . command: uvicorn src.api:app --reload --host 0.0.0.0 --port 8000 environment: - - REDIS_URL=redis://redis:6379 + - KEYDB_URL=redis://keydb:6379 - API_HOSTNAME=http://localhost:8000 ports: - 8000:8000 depends_on: - - redis + - keydb - redis: - image: redis:latest + keydb: + image: eqalpha/keydb:latest + hostname: keydb ports: - - 6379:6379 + - "6379:6379" celery: build: . command: celery --app=src.api.service worker --loglevel=INFO environment: - - REDIS_URL=redis://redis:6379 + - KEYDB_URL=redis://keydb:6379 - API_HOSTNAME=http://localhost:8000 depends_on: - - redis - + - keydb diff --git a/src/requirements.txt b/src/requirements.txt index 212e33a..0fcbe68 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -3,6 +3,5 @@ pytest~=8.3 tmt~=1.35 fastapi~=0.112 httpx~=0.27 -redis~=5.0 uvicorn~=0.30 -celery~=5.4 +celery[redis]~=5.4 diff --git a/src/service.py b/src/service.py index aebbea7..998e6ee 100644 --- a/src/service.py +++ b/src/service.py @@ -11,9 +11,9 @@ logger = tmt.Logger(logging.getLogger("tmt-logger")) -redis_url = os.getenv("REDIS_URL", "redis://localhost:6379") +keydb_url = os.getenv("KEYDB_URL", "redis://keydb:6379") -app = Celery(__name__, broker=redis_url, backend=redis_url) +app = Celery(__name__, broker=keydb_url, backend=keydb_url) def get_tree(url: str, name: str, ref: str, tree_path: str) -> tmt.base.Tree: