Spaces:
Runtime error
Runtime error
Commit
·
d075fb6
1
Parent(s):
e3bc70c
improve docker
Browse files- Dockerfile +1 -1
- app.py +5 -1
Dockerfile
CHANGED
|
@@ -11,4 +11,4 @@ COPY --chown=user ./requirements.txt requirements.txt
|
|
| 11 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 12 |
|
| 13 |
COPY --chown=user . /app
|
| 14 |
-
CMD ["python", "
|
|
|
|
| 11 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 12 |
|
| 13 |
COPY --chown=user . /app
|
| 14 |
+
CMD ["python", "app.py", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
CHANGED
|
@@ -3,6 +3,7 @@ from api.router import health, topic, user, bot, trial, role, reader
|
|
| 3 |
from fastapi.middleware.cors import CORSMiddleware
|
| 4 |
from api.events import register_events
|
| 5 |
from utils.utils import pipe
|
|
|
|
| 6 |
|
| 7 |
def create_instance() -> FastAPI:
|
| 8 |
return FastAPI()
|
|
@@ -39,4 +40,7 @@ def init_app() -> FastAPI:
|
|
| 39 |
)
|
| 40 |
return app
|
| 41 |
|
| 42 |
-
app = init_app()
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
from fastapi.middleware.cors import CORSMiddleware
|
| 4 |
from api.events import register_events
|
| 5 |
from utils.utils import pipe
|
| 6 |
+
import uvicorn
|
| 7 |
|
| 8 |
def create_instance() -> FastAPI:
|
| 9 |
return FastAPI()
|
|
|
|
| 40 |
)
|
| 41 |
return app
|
| 42 |
|
| 43 |
+
app = init_app()
|
| 44 |
+
|
| 45 |
+
if __name__ == '__main__':
|
| 46 |
+
uvicorn.run(app, loop = 'asyncio')
|