Spaces:
Sleeping
Sleeping
Charan Sai Mamidala commited on
Commit ·
b580df0
1
Parent(s): a439670
Refactor for multi-mode deployment: move main.py to server/app.py
Browse files- Dockerfile +1 -1
- openenv.yaml +1 -1
- pyproject.toml +1 -1
- main.py → server/app.py +5 -4
Dockerfile
CHANGED
|
@@ -35,4 +35,4 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
|
|
| 35 |
|
| 36 |
EXPOSE 7860
|
| 37 |
|
| 38 |
-
CMD ["python", "
|
|
|
|
| 35 |
|
| 36 |
EXPOSE 7860
|
| 37 |
|
| 38 |
+
CMD ["python", "server/app.py"]
|
openenv.yaml
CHANGED
|
@@ -2,7 +2,7 @@ name: gdpr_auditor_env
|
|
| 2 |
version: 1.0.0
|
| 3 |
description: GDPR Compliance Auditor - Detect privacy policy violations and dark patterns
|
| 4 |
runtime: fastapi
|
| 5 |
-
app:
|
| 6 |
port: 7860
|
| 7 |
spec_version: "1"
|
| 8 |
type: space
|
|
|
|
| 2 |
version: 1.0.0
|
| 3 |
description: GDPR Compliance Auditor - Detect privacy policy violations and dark patterns
|
| 4 |
runtime: fastapi
|
| 5 |
+
app: server.app:app
|
| 6 |
port: 7860
|
| 7 |
spec_version: "1"
|
| 8 |
type: space
|
pyproject.toml
CHANGED
|
@@ -17,7 +17,7 @@ dependencies = [
|
|
| 17 |
dev = []
|
| 18 |
|
| 19 |
[project.scripts]
|
| 20 |
-
server = "
|
| 21 |
|
| 22 |
[tool.uv]
|
| 23 |
dev-dependencies = []
|
|
|
|
| 17 |
dev = []
|
| 18 |
|
| 19 |
[project.scripts]
|
| 20 |
+
server = "server.app:main"
|
| 21 |
|
| 22 |
[tool.uv]
|
| 23 |
dev-dependencies = []
|
main.py → server/app.py
RENAMED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import sys
|
| 2 |
-
|
|
|
|
| 3 |
|
| 4 |
import uvicorn
|
| 5 |
from fastapi import FastAPI, HTTPException, Request
|
|
@@ -274,9 +275,9 @@ async def state():
|
|
| 274 |
return env.state()
|
| 275 |
|
| 276 |
|
| 277 |
-
def
|
| 278 |
-
uvicorn.run("
|
| 279 |
|
| 280 |
|
| 281 |
if __name__ == "__main__":
|
| 282 |
-
|
|
|
|
| 1 |
import sys
|
| 2 |
+
import os
|
| 3 |
+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
| 4 |
|
| 5 |
import uvicorn
|
| 6 |
from fastapi import FastAPI, HTTPException, Request
|
|
|
|
| 275 |
return env.state()
|
| 276 |
|
| 277 |
|
| 278 |
+
def main():
|
| 279 |
+
uvicorn.run("server.app:app", host="0.0.0.0", port=7860)
|
| 280 |
|
| 281 |
|
| 282 |
if __name__ == "__main__":
|
| 283 |
+
main()
|