1
0
mirror of https://gitlab.com/simple-stock-bots/simple-telegram-stock-bot.git synced 2025-06-16 06:56:46 +00:00

refactor telegram bot to use docker compose

This commit is contained in:
Anson 2023-09-03 01:29:10 -06:00
parent 68eca88034
commit 2ed995393b
11 changed files with 386 additions and 375 deletions

0
.env Normal file
View File

View File

@ -8,7 +8,7 @@ import pytz
import requests as r
import schedule
from Symbol import Stock
from common.Symbol import Stock
log = logging.getLogger(__name__)

View File

@ -6,7 +6,7 @@ import requests as r
import schedule
from markdownify import markdownify
from Symbol import Coin
from common.Symbol import Coin
log = logging.getLogger(__name__)

View File

@ -10,9 +10,9 @@ import pandas as pd
import schedule
from cachetools import TTLCache, cached
from cg_Crypto import cg_Crypto
from MarketData import MarketData
from Symbol import Coin, Stock, Symbol
from common.cg_Crypto import cg_Crypto
from common.MarketData import MarketData
from common.Symbol import Coin, Stock, Symbol
from typing import Dict

View File

@ -1,4 +1,4 @@
-r requirements.txt
-r telegram/requirements.txt
black==23.3.0
flake8==5.0.4
Flake8-pyproject==1.2.3

7
docker-compose.yaml Normal file
View File

@ -0,0 +1,7 @@
version: '3'
services:
telegram:
build:
context: .
dockerfile: telegram/Dockerfile
env_file: .env

View File

@ -1,7 +1,8 @@
FROM python:3.11-buster AS builder
COPY requirements.txt /requirements.txt
COPY telegram/requirements.txt .
RUN pip install --user -r requirements.txt
@ -12,6 +13,9 @@ ENV MPLBACKEND=Agg
COPY --from=builder /root/.local /root/.local
COPY . .
COPY common common
COPY telegram .
CMD [ "python", "./bot.py" ]

View File

@ -28,7 +28,7 @@ from telegram.ext import (
Updater,
)
from symbol_router import Router
from common.symbol_router import Router
from T_info import T_info
# Enable logging