prod tuning

This commit is contained in:
bvn13 2024-07-10 23:52:19 +03:00
parent 2ee1722836
commit 1f9d38148c
7 changed files with 83 additions and 33 deletions

2
.gitignore vendored
View File

@ -3,4 +3,4 @@ local.env
test/
newsmaker.session
newsmaker.session-journal
newsmaker.session.bup
newsmaker-prod.session

3
.vscode/launch.json vendored
View File

@ -4,9 +4,6 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: main.py",
"type": "debugpy",

View File

@ -2,6 +2,8 @@ FROM python:3.10
RUN apt-get install libpq-dev -y
RUN apt-get install clang lib{jpeg-turbo,webp}-dev python{,-dev} zlib-dev
ADD requirements.txt requirements.txt
RUN pip install -r requirements.txt

View File

@ -0,0 +1,28 @@
{
"onMessage": {
"-1001491510225": [
{
"filter": {
"type": "contain",
"value": "Школьный"
},
"action": {
"type": "forward",
"chatId": -1001699667908
}
}
],
"-1001652154331": [
{
"filter": {
"type": "contain",
"value": "Школьный"
},
"action": {
"type": "forward",
"chatId": -1001699667908
}
}
]
}
}

40
config/newsmaker.json Normal file
View File

@ -0,0 +1,40 @@
{
"onMessage": {
"-1001491510225": [
{
"filter": {
"type": "contain",
"value": "Школьный"
},
"action": {
"type": "forward",
"chatId": -1001699667908
}
}
],
"-1002182676107": [
{
"filter": {
"type": "contain",
"value": "Школьный"
},
"action": {
"type": "forward",
"chatId": -1002184916546
}
}
],
"-1001652154331": [
{
"filter": {
"type": "contain",
"value": "Школьный"
},
"action": {
"type": "forward",
"chatId": -1001699667908
}
}
]
}
}

View File

@ -1,25 +1,16 @@
version: '3.3'
networks:
jedoist:
external: true
services:
bot:
# build: ./
image: localhost:5001/jedoist:${APP_VERSION}
image: localhost:5001/tg-newsmaker:${APP_VERSION}
environment:
- BOT_TOKEN=${BOT_TOKEN}
- VK_CLIENT_ID=${VK_CLIENT_ID}
- VK_SECRET_KEY=${VK_SECRET_KEY}
- BOT_OWNER_ID=258985362
- DB_HOST=jedoist-db
- DB_NAME=jedoist-db
- DB_USER=${DB_USER}
- DB_PASS=${DB_PASS}
- VOICES_PATH=${VOICES_PATH}
- CONFIG_FILE=/mnt/config.json
- SESSION_FILE=/mnt/newsmaker.session
- TG_APP_ID=/run/secrets/tg_app_id
- TG_APP_HASH=/run/secrets/tg_app_hash
restart: always
depends_on:
- bot-db
@ -27,18 +18,9 @@ services:
- jedoist
volumes:
- ${CONFIG_FILE}:/mnt/config.json
bot-db:
image: postgres:14
container_name: jedoist-db
restart: always
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASS}
POSTGRES_DB: jedoist-db
networks:
- jedoist
volumes:
- ${DB_VOLUME}:/var/lib/postgresql/data
ports:
- 5432:5432
- ${SESSION_FILE}:/mnt/newsmaker.session
secrets:
tg_app_id:
environment: "TG_APP_ID"
tg_app_hash:
environment: "TG_APP_HASH"

View File

@ -1,2 +1,3 @@
aiohttp==3.9.5
telethon==1.36.0
telethon==1.36.0
cryptg==0.4.0