Skip to content

Commit

Permalink
feat: service developments
Browse files Browse the repository at this point in the history
  • Loading branch information
fmelihh committed Jul 19, 2024
1 parent 3b8aa19 commit 0a9b72a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ REDIS_PORT=6379

## CELERY
CELERY_TIMEZONE=UTC

## CLICKHOUSE
CLICKHOUSE_URL=clickhouse+native://default:@ch_server:8123/default
5 changes: 4 additions & 1 deletion .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ REDIS_HOST=localhost
REDIS_PORT=6379

## CELERY
CELERY_TIMEZONE=UTC
CELERY_TIMEZONE=UTC

#CLICKHOUSE
CLICKHOUSE_URL=clickhouse+native://default:@localhost:8123/default
31 changes: 30 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,43 @@ services:
container_name: search-project
user: root
environment:
ENV_FOR_DYNACONF: docker
- ENVIRONMENT=docker
command: "python /opt/search/main.py"
ports:
- "8000:8000"
volumes:
- .:/opt/search
depends_on:
- "redis"
celery_worker:
hostname: search-celery-worker
container_name: search-celery-worker
build:
context: .
dockerfile: Dockerfile
environment:
- ENVIRONMENT=docker
command: >
bash -c "celery -A main.celery_app worker -l info -E -Q periodic,daily"
volumes:
- .:/opt/b2m
depends_on:
- "redis"
celery-beat:
image: search-celery-beat
hostname: search-celery-beat
build:
context: .
dockerfile: Dockerfile
environment:
- ENVIRONMENT=docker
command: >
bash -c " celery -A b2metric.celery.app beat -s data/redis/scheduler.db -S redbeat.RedBeatScheduler -l INFO"
volumes:
- .:/opt/b2m
depends_on:
- "search-project"
- "redis"
redis:
image: redis
hostname: redis
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from loguru import logger
from typing import Iterator

Expand All @@ -6,7 +7,7 @@
from sqlalchemy.ext.declarative import declarative_base


engine = create_engine("clickhouse+native://default:@localhost/default", future=True)
engine = create_engine("clickhouse+native://default:@localhost:8123/default", future=True)

SessionLocal = sessionmaker(
autocommit=False,
Expand Down

0 comments on commit 0a9b72a

Please sign in to comment.