Spaces:
Sleeping
Sleeping
Dev Shah commited on
Commit ·
da62f9f
1
Parent(s): a4d97e5
refactor: restructure repository for OpenEnv multi-mode deployment, moved server.py to server/app.py
Browse files- Dockerfile +1 -1
- openenv.yaml +1 -1
- pyproject.toml +1 -1
- server.py → server/app.py +5 -0
Dockerfile
CHANGED
|
@@ -18,4 +18,4 @@ COPY . .
|
|
| 18 |
EXPOSE 7860
|
| 19 |
|
| 20 |
# Default: run the environment server
|
| 21 |
-
CMD ["python", "server.
|
|
|
|
| 18 |
EXPOSE 7860
|
| 19 |
|
| 20 |
# Default: run the environment server
|
| 21 |
+
CMD ["python", "-m", "server.app"]
|
openenv.yaml
CHANGED
|
@@ -49,7 +49,7 @@ tasks:
|
|
| 49 |
|
| 50 |
environment:
|
| 51 |
language: python
|
| 52 |
-
entry_point: server.py
|
| 53 |
port: 7860
|
| 54 |
health_check: /health
|
| 55 |
state_endpoint: /state
|
|
|
|
| 49 |
|
| 50 |
environment:
|
| 51 |
language: python
|
| 52 |
+
entry_point: server/app.py
|
| 53 |
port: 7860
|
| 54 |
health_check: /health
|
| 55 |
state_endpoint: /state
|
pyproject.toml
CHANGED
|
@@ -17,4 +17,4 @@ dependencies = [
|
|
| 17 |
]
|
| 18 |
|
| 19 |
[project.scripts]
|
| 20 |
-
server = "server:main"
|
|
|
|
| 17 |
]
|
| 18 |
|
| 19 |
[project.scripts]
|
| 20 |
+
server = "server.app:main"
|
server.py → server/app.py
RENAMED
|
@@ -8,6 +8,11 @@ from fastapi.middleware.cors import CORSMiddleware
|
|
| 8 |
from pydantic import BaseModel
|
| 9 |
from typing import Optional
|
| 10 |
import uvicorn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
from environment import EmailTriageEnv, Action
|
| 13 |
|
|
|
|
| 8 |
from pydantic import BaseModel
|
| 9 |
from typing import Optional
|
| 10 |
import uvicorn
|
| 11 |
+
import os
|
| 12 |
+
import sys
|
| 13 |
+
|
| 14 |
+
# Ensure the root directory is in sys.path so environment.py can be imported
|
| 15 |
+
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
|
| 16 |
|
| 17 |
from environment import EmailTriageEnv, Action
|
| 18 |
|