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/ test/
newsmaker.session newsmaker.session
newsmaker.session-journal 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 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "Python Debugger: main.py", "name": "Python Debugger: main.py",
"type": "debugpy", "type": "debugpy",

View File

@ -2,6 +2,8 @@ FROM python:3.10
RUN apt-get install libpq-dev -y 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 ADD requirements.txt requirements.txt
RUN pip install -r 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' version: '3.3'
networks:
jedoist:
external: true
services: services:
bot: bot:
# build: ./ # build: ./
image: localhost:5001/jedoist:${APP_VERSION} image: localhost:5001/tg-newsmaker:${APP_VERSION}
environment: environment:
- BOT_TOKEN=${BOT_TOKEN}
- VK_CLIENT_ID=${VK_CLIENT_ID}
- VK_SECRET_KEY=${VK_SECRET_KEY}
- BOT_OWNER_ID=258985362 - 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 - 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 restart: always
depends_on: depends_on:
- bot-db - bot-db
@ -27,18 +18,9 @@ services:
- jedoist - jedoist
volumes: volumes:
- ${CONFIG_FILE}:/mnt/config.json - ${CONFIG_FILE}:/mnt/config.json
- ${SESSION_FILE}:/mnt/newsmaker.session
bot-db: secrets:
image: postgres:14 tg_app_id:
container_name: jedoist-db environment: "TG_APP_ID"
restart: always tg_app_hash:
environment: environment: "TG_APP_HASH"
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASS}
POSTGRES_DB: jedoist-db
networks:
- jedoist
volumes:
- ${DB_VOLUME}:/var/lib/postgresql/data
ports:
- 5432:5432

View File

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