MrSiebel585 commited on
Commit
1580fbc
·
1 Parent(s): 496e671

🚀 Add hybrid FastAPI entrypoint with Docker support

Browse files
Files changed (3) hide show
  1. Dockerfile +18 -0
  2. app.py +12 -0
  3. requirements.txt +14 -0
Dockerfile ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # Add user
4
+ RUN useradd -m -u 1000 user
5
+ USER user
6
+ ENV PATH="/home/user/.local/bin:$PATH"
7
+
8
+ WORKDIR /app
9
+
10
+ # Install dependencies
11
+ COPY --chown=user requirements.txt requirements.txt
12
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
+
14
+ # Copy project
15
+ COPY --chown=user . /app
16
+
17
+ # Run FastAPI (main entrypoint for the Space)
18
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
app.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+ from fastapi.responses import JSONResponse
3
+
4
+ app = FastAPI(title="Omniscient Hybrid UI")
5
+
6
+ @app.get("/")
7
+ def root():
8
+ return {"status": "ok", "message": "Omniscient Hybrid Space Running!"}
9
+
10
+ @app.get("/health")
11
+ def health():
12
+ return JSONResponse({"ok": True, "frameworks": ["Streamlit", "Gradio", "Chainlit"]})
requirements.txt ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Core frameworks
2
+ streamlit
3
+ gradio
4
+ chainlit
5
+
6
+ # API & server
7
+ fastapi
8
+ uvicorn[standard]
9
+ pydantic
10
+ requests
11
+
12
+ # AI clients
13
+ openai
14
+ ollama