Spaces:
Runtime error
Runtime error
Dmitry Beresnev
commited on
Commit
·
b6e22da
1
Parent(s):
a639b7c
fix docker file and tg bot
Browse files- Dockerfile +2 -2
- src/telegram_bot.py +2 -0
Dockerfile
CHANGED
|
@@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y \
|
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
COPY requirements.txt ./
|
| 17 |
-
COPY src/ ./
|
| 18 |
|
| 19 |
RUN pip3 install -r requirements.txt
|
| 20 |
|
|
@@ -22,4 +22,4 @@ EXPOSE 8443
|
|
| 22 |
|
| 23 |
HEALTHCHECK CMD curl --fail http://localhost:8443/_stcore/health
|
| 24 |
|
| 25 |
-
ENTRYPOINT ["python3", "
|
|
|
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
COPY requirements.txt ./
|
| 17 |
+
COPY src/ ./src/
|
| 18 |
|
| 19 |
RUN pip3 install -r requirements.txt
|
| 20 |
|
|
|
|
| 22 |
|
| 23 |
HEALTHCHECK CMD curl --fail http://localhost:8443/_stcore/health
|
| 24 |
|
| 25 |
+
ENTRYPOINT ["python3", "src/telegram_bot.py"]
|
src/telegram_bot.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import logging
|
| 2 |
import os
|
|
|
|
| 3 |
from typing import Any
|
| 4 |
|
| 5 |
from telegram import Update
|
|
@@ -8,6 +9,7 @@ from dotenv import load_dotenv
|
|
| 8 |
from src.financial_news_requester import fetch_comp_financial_news
|
| 9 |
|
| 10 |
|
|
|
|
| 11 |
load_dotenv()
|
| 12 |
|
| 13 |
TELEGRAM_TOKEN = os.getenv("TELEGRAM_TOKEN")
|
|
|
|
| 1 |
import logging
|
| 2 |
import os
|
| 3 |
+
import sys
|
| 4 |
from typing import Any
|
| 5 |
|
| 6 |
from telegram import Update
|
|
|
|
| 9 |
from src.financial_news_requester import fetch_comp_financial_news
|
| 10 |
|
| 11 |
|
| 12 |
+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
| 13 |
load_dotenv()
|
| 14 |
|
| 15 |
TELEGRAM_TOKEN = os.getenv("TELEGRAM_TOKEN")
|