Dmitry Beresnev commited on
Commit
0c9698b
·
1 Parent(s): 9f94d9d

test hello world app

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -2
  2. main.py +5 -0
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
- 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"]
 
57
  CMD curl --fail http://localhost:7860/health || exit 1
58
 
59
  # Run the application when the container starts HF
60
+ #CMD ["uvicorn", "src.telegram_bot: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
@@ -7,9 +7,14 @@ if __name__ == "__main__":
7
  '''
8
 
9
  from fastapi import FastAPI
 
10
 
11
  app = FastAPI()
12
 
13
  @app.get("/")
14
  def read_root():
15
  return {"Hello": "World"}
 
 
 
 
 
7
  '''
8
 
9
  from fastapi import FastAPI
10
+ import uvicorn
11
 
12
  app = FastAPI()
13
 
14
  @app.get("/")
15
  def read_root():
16
  return {"Hello": "World"}
17
+
18
+
19
+ if __name__ == "__main__":
20
+ uvicorn.run(app, host="0.0.0.0", port=7860)