Spaces:
Paused
Paused
add
Browse files- Dockerfile +1 -1
- app.py +6 -1
Dockerfile
CHANGED
|
@@ -13,5 +13,5 @@ COPY --chown=user ./requirements.txt requirements.txt
|
|
| 13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 14 |
|
| 15 |
COPY --chown=user . /app
|
| 16 |
-
|
| 17 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 14 |
|
| 15 |
COPY --chown=user . /app
|
| 16 |
+
|
| 17 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
CHANGED
|
@@ -1,7 +1,12 @@
|
|
| 1 |
from fastapi import FastAPI
|
|
|
|
| 2 |
|
| 3 |
app = FastAPI()
|
| 4 |
-
|
|
|
|
|
|
|
| 5 |
@app.get("/")
|
| 6 |
def greet_json():
|
|
|
|
| 7 |
return {"Hello": "World!"}
|
|
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
+
import threading
|
| 3 |
|
| 4 |
app = FastAPI()
|
| 5 |
+
def bot_run():
|
| 6 |
+
import os
|
| 7 |
+
os.system("python bot_main.py")
|
| 8 |
@app.get("/")
|
| 9 |
def greet_json():
|
| 10 |
+
threading.Thread(target=bot_run).start()
|
| 11 |
return {"Hello": "World!"}
|
| 12 |
+
|