96 lines
2.1 KiB
YAML
96 lines
2.1 KiB
YAML
|
|
name: law-bot
|
||
|
|
x-default-logging: &default-logging
|
||
|
|
driver: json-file
|
||
|
|
options:
|
||
|
|
max-size: "10m"
|
||
|
|
max-file: "3"
|
||
|
|
|
||
|
|
services:
|
||
|
|
tgbot:
|
||
|
|
build:
|
||
|
|
context: .
|
||
|
|
dockerfile: bot/Dockerfile
|
||
|
|
network: host
|
||
|
|
restart: unless-stopped
|
||
|
|
env_file:
|
||
|
|
- ./bot/.env
|
||
|
|
- ./postgres.env
|
||
|
|
environment:
|
||
|
|
- REDIS_URL=redis://redisdb:6379/0
|
||
|
|
- POSTGRES_HOST=postgredb
|
||
|
|
- POSTGRES_PORT=5432
|
||
|
|
- RAG_API_URL=http://api:8080
|
||
|
|
depends_on:
|
||
|
|
redisdb:
|
||
|
|
condition: service_healthy
|
||
|
|
postgredb:
|
||
|
|
condition: service_healthy
|
||
|
|
api:
|
||
|
|
condition: service_healthy
|
||
|
|
command: python aiogram_run.py
|
||
|
|
logging: *default-logging
|
||
|
|
|
||
|
|
redisdb:
|
||
|
|
image: redis:6-alpine
|
||
|
|
restart: unless-stopped
|
||
|
|
healthcheck:
|
||
|
|
test: ["CMD", "redis-cli", "ping"]
|
||
|
|
interval: 5s
|
||
|
|
timeout: 5s
|
||
|
|
retries: 5
|
||
|
|
logging: *default-logging
|
||
|
|
|
||
|
|
chromadb:
|
||
|
|
image: chromadb/chroma:1.0.12
|
||
|
|
restart: unless-stopped
|
||
|
|
ports:
|
||
|
|
- "8000:8000"
|
||
|
|
environment:
|
||
|
|
- IS_PERSISTENT=TRUE
|
||
|
|
- PERSIST_DIRECTORY=/data
|
||
|
|
volumes:
|
||
|
|
- ./volumes/chroma:/data
|
||
|
|
logging: *default-logging
|
||
|
|
|
||
|
|
postgredb:
|
||
|
|
image: postgres:16-alpine
|
||
|
|
restart: unless-stopped
|
||
|
|
env_file:
|
||
|
|
- ./postgres.env
|
||
|
|
volumes:
|
||
|
|
- ./volumes/postgres:/var/lib/postgresql/data
|
||
|
|
healthcheck:
|
||
|
|
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
|
||
|
|
interval: 5s
|
||
|
|
timeout: 5s
|
||
|
|
retries: 5
|
||
|
|
logging: *default-logging
|
||
|
|
|
||
|
|
api:
|
||
|
|
build:
|
||
|
|
context: .
|
||
|
|
dockerfile: api/Dockerfile
|
||
|
|
network: host
|
||
|
|
restart: unless-stopped
|
||
|
|
ports:
|
||
|
|
- "8080:8080"
|
||
|
|
env_file:
|
||
|
|
- ./api/.env
|
||
|
|
- ./postgres.env
|
||
|
|
environment:
|
||
|
|
- CHROMA_HOST=chromadb
|
||
|
|
- CHROMA_PORT=8000
|
||
|
|
volumes:
|
||
|
|
- ./volumes/huggingface:/root/.cache/huggingface
|
||
|
|
depends_on:
|
||
|
|
postgredb:
|
||
|
|
condition: service_healthy
|
||
|
|
chromadb:
|
||
|
|
condition: service_started
|
||
|
|
healthcheck:
|
||
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health', timeout=5)"]
|
||
|
|
interval: 10s
|
||
|
|
timeout: 5s
|
||
|
|
retries: 10
|
||
|
|
logging: *default-logging
|