From 204120c6a1d96cc3bbb6ca426e629704d3cbe708 Mon Sep 17 00:00:00 2001 From: Drew Bednar Date: Thu, 16 Feb 2023 18:29:04 -0500 Subject: [PATCH] Remove separate docker compose for redis --- docker-compose-redis.yml | 9 --------- docker-compose.yml | 4 ++++ tasks.py | 16 +--------------- 3 files changed, 5 insertions(+), 24 deletions(-) delete mode 100644 docker-compose-redis.yml diff --git a/docker-compose-redis.yml b/docker-compose-redis.yml deleted file mode 100644 index 5fd2d0e..0000000 --- a/docker-compose-redis.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: '3.8' - -services: - - redis: - image: redis:7.0.4-alpine - restart: always - ports: - - 6379:6379 diff --git a/docker-compose.yml b/docker-compose.yml index 6739866..20862be 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,9 +28,13 @@ services: - POSTGRES_DB=fastapi_celery - POSTGRES_USER=fastapi_celery - POSTGRES_PASSWORD=fastapi_celery + ports: + - 5432:5432 redis: image: redis:7-alpine + ports: + - 6379:6379 celery_worker: build: diff --git a/tasks.py b/tasks.py index 19dd154..c3adba1 100644 --- a/tasks.py +++ b/tasks.py @@ -34,20 +34,6 @@ def fix_eof(c): c.run("pre-commit run end-of-file-fixer --all-files", pty=True) -@task -def start_redis(c): - """Runs the Redis integration environment.""" - print("Starting Redis") - c.run("docker compose -f docker-compose-redis.yml up -d") - - -@task -def stop_redis(c): - """Stops the Redis integration environent.""" - print("Stopping Redis") - c.run("docker compose -f docker-compose-redis.yml down") - - @task def init_db(c): """Initialize the database.""" @@ -72,7 +58,7 @@ def apply_migration(c, revision="head"): @task(help={"username": "A username", "email": "The user's email"}) def add_user(c, username="", email=""): - """Adds a dummy user to the application Database""" + """Adds a dummy user to the application database""" if not (username and email): raise ValueError("You must provide a username and email") from project.database import SessionLocal