Spaces:
Runtime error
Runtime error
Dmitry Beresnev
commited on
Commit
·
9f94d9d
1
Parent(s):
be62f09
test hello world
Browse files- Dockerfile +2 -2
- main.py +10 -0
- src/telegram_bot.py +1 -1
Dockerfile
CHANGED
|
@@ -57,7 +57,7 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
|
| 57 |
CMD curl --fail http://localhost:7860/health || exit 1
|
| 58 |
|
| 59 |
# Run the application when the container starts HF
|
| 60 |
-
|
| 61 |
-
CMD ["python", "main.py"]
|
| 62 |
# Uncomment the line below to run the application locally
|
| 63 |
#CMD ["python", "-m", "telegram_bot"]
|
|
|
|
| 57 |
CMD curl --fail http://localhost:7860/health || exit 1
|
| 58 |
|
| 59 |
# Run the application when the container starts HF
|
| 60 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 61 |
+
#CMD ["python", "main.py"]
|
| 62 |
# Uncomment the line below to run the application locally
|
| 63 |
#CMD ["python", "-m", "telegram_bot"]
|
main.py
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
|
|
| 1 |
from src.telegram_bot import main as telegram_bot
|
| 2 |
|
| 3 |
|
| 4 |
if __name__ == "__main__":
|
| 5 |
telegram_bot()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'''
|
| 2 |
from src.telegram_bot import main as telegram_bot
|
| 3 |
|
| 4 |
|
| 5 |
if __name__ == "__main__":
|
| 6 |
telegram_bot()
|
| 7 |
+
'''
|
| 8 |
+
|
| 9 |
+
from fastapi import FastAPI
|
| 10 |
+
|
| 11 |
+
app = FastAPI()
|
| 12 |
+
|
| 13 |
+
@app.get("/")
|
| 14 |
+
def read_root():
|
| 15 |
+
return {"Hello": "World"}
|
src/telegram_bot.py
CHANGED
|
@@ -199,4 +199,4 @@ def main() -> None:
|
|
| 199 |
logger.info("After deployment, visit /set_webhook to configure the webhook")
|
| 200 |
|
| 201 |
uvicorn.run(app, host="0.0.0.0", port=PORT)
|
| 202 |
-
#application.run_polling()
|
|
|
|
| 199 |
logger.info("After deployment, visit /set_webhook to configure the webhook")
|
| 200 |
|
| 201 |
uvicorn.run(app, host="0.0.0.0", port=PORT)
|
| 202 |
+
#application.run_polling()
|