forked from zovos/bot_tg
- Все 4 SQLite базы объединены в одну PostgreSQL - Новый db.py с ThreadedConnectionPool (psycopg2) - docker-compose: сервис postgres с healthcheck, данные в ./db/postgres - scripts/migrate_sqlite_to_pg.py — миграция существующих данных - Убраны мёртвый код и дублирующий import в main.py и talk_handler.py - .env удалён из git-индекса Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
82 lines
2.2 KiB
YAML
82 lines
2.2 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_DB: botdb
|
|
POSTGRES_USER: bot
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-botpass}
|
|
volumes:
|
|
- ./db/postgres:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U bot -d botdb"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
restart: unless-stopped
|
|
|
|
bot:
|
|
build:
|
|
context: .
|
|
volumes:
|
|
- ./db:/db
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
TZ: Europe/Moscow
|
|
DATABASE_URL: postgresql://bot:${POSTGRES_PASSWORD:-botpass}@postgres:5432/botdb
|
|
POLYCHAETSI_STATS_PATH: /db/polychaetsi_stats.json
|
|
NUDE_HISTORY_PATH: /db/nude_history.json
|
|
LLAMA_API_URL: ${LLAMA_API_URL:-https://mirror.porno4free.ru/zovos-ai/}
|
|
LLAMA_FORCE_DISABLE_THINKING: ${LLAMA_FORCE_DISABLE_THINKING:-0}
|
|
LLAMA_LOG_THINKING: ${LLAMA_LOG_THINKING:-1}
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
init: true
|
|
restart: unless-stopped
|
|
|
|
webapp-api:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.api
|
|
volumes:
|
|
- ./db:/db
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
TZ: Europe/Moscow
|
|
DATABASE_URL: postgresql://bot:${POSTGRES_PASSWORD:-botpass}@postgres:5432/botdb
|
|
POLYCHAETSI_STATS_PATH: /db/polychaetsi_stats.json
|
|
NUDE_HISTORY_PATH: /db/nude_history.json
|
|
API_PORT: "8080"
|
|
LLAMA_API_URL: ${LLAMA_API_URL:-https://mirror.porno4free.ru/zovos-ai/}
|
|
LLAMA_FORCE_DISABLE_THINKING: ${LLAMA_FORCE_DISABLE_THINKING:-0}
|
|
LLAMA_LOG_THINKING: ${LLAMA_LOG_THINKING:-1}
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
webapp-frontend:
|
|
build:
|
|
context: ./webapp/frontend
|
|
ports:
|
|
- "${WEBAPP_HTTP_PORT:-80}:80"
|
|
- "${WEBAPP_HTTPS_PORT:-443}:443"
|
|
environment:
|
|
APP_DOMAIN: ${APP_DOMAIN:-}
|
|
APP_WWW_DOMAIN: ${APP_WWW_DOMAIN:-}
|
|
ACME_EMAIL: ${ACME_EMAIL:-}
|
|
CERTBOT_STAGING: ${CERTBOT_STAGING:-0}
|
|
CERTBOT_RENEW_INTERVAL: ${CERTBOT_RENEW_INTERVAL:-12h}
|
|
volumes:
|
|
- certbot_etc:/etc/letsencrypt
|
|
- certbot_www:/var/www/certbot
|
|
depends_on:
|
|
- webapp-api
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data:
|
|
certbot_etc:
|
|
certbot_www:
|