fixes
All checks were successful
SonarQube / Build and analyze (push) Successful in 2m57s

This commit is contained in:
Leonid Pershin
2025-10-22 03:28:48 +03:00
parent 1996fec14f
commit 0e5c418a0e
8 changed files with 492 additions and 64 deletions

58
docker-compose.yml Normal file
View File

@@ -0,0 +1,58 @@
version: '3.8'
services:
postgres:
image: postgres:16-alpine
container_name: chatbot-postgres
environment:
POSTGRES_DB: ${DB_NAME:-chatbot}
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}
ports:
- "${DB_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- chatbot-network
chatbot:
build:
context: ./ChatBot
dockerfile: Dockerfile
container_name: chatbot-app
depends_on:
postgres:
condition: service_healthy
environment:
- DB_HOST=postgres
- DB_PORT=5432
- DB_NAME=${DB_NAME:-chatbot}
- DB_USER=${DB_USER:-postgres}
- DB_PASSWORD=${DB_PASSWORD:-postgres}
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
- OLLAMA_URL=${OLLAMA_URL}
- OLLAMA_DEFAULT_MODEL=${OLLAMA_DEFAULT_MODEL:-gemma3:4b}
volumes:
- ./ChatBot/logs:/app/logs
restart: unless-stopped
networks:
- chatbot-network
healthcheck:
test: ["CMD", "dotnet", "ChatBot.dll", "--health-check"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
postgres_data:
driver: local
networks:
chatbot-network:
driver: bridge