Use 2 docker containers for bot and webservice

This commit is contained in:
2022-03-12 20:02:39 +01:00
parent 5002d8509b
commit fdd7bc2d4c
14 changed files with 48 additions and 16 deletions

25
webservice/app.py Normal file
View File

@@ -0,0 +1,25 @@
import multiprocessing as mp
import time
from flask import Flask
from telegram_bot.bot import bot
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
proc1 = mp.Process(target=app.run, args=())
proc1.start()
while True:
try:
bot.polling(none_stop=True)
except Exception as e:
print(f"[EXCEPTION] {e}")
time.sleep(15)