mirror of
https://gitlab.com/simple-stock-bots/simple-stock-bot.git
synced 2025-06-16 07:16:40 +00:00
refactor telegram bot to use docker compose
This commit is contained in:
parent
68eca88034
commit
2ed995393b
@ -8,7 +8,7 @@ import pytz
|
|||||||
import requests as r
|
import requests as r
|
||||||
import schedule
|
import schedule
|
||||||
|
|
||||||
from Symbol import Stock
|
from common.Symbol import Stock
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
@ -6,7 +6,7 @@ import requests as r
|
|||||||
import schedule
|
import schedule
|
||||||
from markdownify import markdownify
|
from markdownify import markdownify
|
||||||
|
|
||||||
from Symbol import Coin
|
from common.Symbol import Coin
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
@ -10,9 +10,9 @@ import pandas as pd
|
|||||||
import schedule
|
import schedule
|
||||||
from cachetools import TTLCache, cached
|
from cachetools import TTLCache, cached
|
||||||
|
|
||||||
from cg_Crypto import cg_Crypto
|
from common.cg_Crypto import cg_Crypto
|
||||||
from MarketData import MarketData
|
from common.MarketData import MarketData
|
||||||
from Symbol import Coin, Stock, Symbol
|
from common.Symbol import Coin, Stock, Symbol
|
||||||
|
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
-r requirements.txt
|
-r telegram/requirements.txt
|
||||||
black==23.3.0
|
black==23.3.0
|
||||||
flake8==5.0.4
|
flake8==5.0.4
|
||||||
Flake8-pyproject==1.2.3
|
Flake8-pyproject==1.2.3
|
||||||
|
7
docker-compose.yaml
Normal file
7
docker-compose.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
telegram:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: telegram/Dockerfile
|
||||||
|
env_file: .env
|
@ -1,7 +1,8 @@
|
|||||||
FROM python:3.11-buster AS builder
|
FROM python:3.11-buster AS builder
|
||||||
|
|
||||||
|
|
||||||
COPY requirements.txt /requirements.txt
|
COPY telegram/requirements.txt .
|
||||||
|
|
||||||
RUN pip install --user -r requirements.txt
|
RUN pip install --user -r requirements.txt
|
||||||
|
|
||||||
|
|
||||||
@ -12,6 +13,9 @@ ENV MPLBACKEND=Agg
|
|||||||
COPY --from=builder /root/.local /root/.local
|
COPY --from=builder /root/.local /root/.local
|
||||||
|
|
||||||
|
|
||||||
COPY . .
|
COPY common common
|
||||||
|
COPY telegram .
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CMD [ "python", "./bot.py" ]
|
CMD [ "python", "./bot.py" ]
|
@ -28,7 +28,7 @@ from telegram.ext import (
|
|||||||
Updater,
|
Updater,
|
||||||
)
|
)
|
||||||
|
|
||||||
from symbol_router import Router
|
from common.symbol_router import Router
|
||||||
from T_info import T_info
|
from T_info import T_info
|
||||||
|
|
||||||
# Enable logging
|
# Enable logging
|
Loading…
x
Reference in New Issue
Block a user