Spaces:
Runtime error
Runtime error
MohitGupta41 commited on
Commit ·
eab3278
1
Parent(s): 02be258
Initial Commit
Browse files- .dockerignore +1 -1
- Frontend/.dockerignore +16 -0
- Src/.dockerignore +16 -0
- Src/api/fastapi_app.py +12 -12
- docker-compose.yml +35 -5
.dockerignore
CHANGED
|
@@ -8,5 +8,5 @@ __pycache__/
|
|
| 8 |
Secrets/
|
| 9 |
# Frontend/
|
| 10 |
Notebooks/
|
| 11 |
-
|
| 12 |
dvc_storage/
|
|
|
|
| 8 |
Secrets/
|
| 9 |
# Frontend/
|
| 10 |
Notebooks/
|
| 11 |
+
Test/
|
| 12 |
dvc_storage/
|
Frontend/.dockerignore
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ignore unnecessary files
|
| 2 |
+
__pycache__/
|
| 3 |
+
*.pyc
|
| 4 |
+
*.pyo
|
| 5 |
+
*.pyd
|
| 6 |
+
*.log
|
| 7 |
+
*.ipynb
|
| 8 |
+
.git
|
| 9 |
+
.gitignore
|
| 10 |
+
|
| 11 |
+
# Only include Streamlit frontend
|
| 12 |
+
!App.py
|
| 13 |
+
!config.py
|
| 14 |
+
!pages/
|
| 15 |
+
!Dockerfile
|
| 16 |
+
!requirements.txt
|
Src/.dockerignore
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ignore everything except backend-relevant files
|
| 2 |
+
__pycache__/
|
| 3 |
+
*.pyc
|
| 4 |
+
*.pyo
|
| 5 |
+
*.pyd
|
| 6 |
+
*.ipynb
|
| 7 |
+
*.log
|
| 8 |
+
|
| 9 |
+
# Only include API and necessary logic
|
| 10 |
+
!api/
|
| 11 |
+
!agent/
|
| 12 |
+
!rag/
|
| 13 |
+
!services/
|
| 14 |
+
!fastapi_app.py
|
| 15 |
+
!Dockerfile
|
| 16 |
+
!requirements.txt
|
Src/api/fastapi_app.py
CHANGED
|
@@ -26,20 +26,20 @@ def startup_event():
|
|
| 26 |
init_db()
|
| 27 |
seed_data()
|
| 28 |
|
| 29 |
-
|
| 30 |
-
# def read_root():
|
| 31 |
-
# return {"Hello": "World!"}
|
| 32 |
-
class Message(BaseModel):
|
| 33 |
-
message: str
|
| 34 |
-
|
| 35 |
-
@app.get("/", response_model=Message, summary="Root Endpoint", tags=["Root"])
|
| 36 |
def read_root():
|
| 37 |
-
"""
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
|
| 44 |
# ----------------------------
|
| 45 |
# 1. Medical RAG Chatbot
|
|
|
|
| 26 |
init_db()
|
| 27 |
seed_data()
|
| 28 |
|
| 29 |
+
@app.get("/")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
def read_root():
|
| 31 |
+
return {"message": "API is live!"}
|
| 32 |
+
# class Message(BaseModel):
|
| 33 |
+
# message: str
|
| 34 |
+
|
| 35 |
+
# @app.get("/", response_model=Message, summary="Root Endpoint", tags=["Root"])
|
| 36 |
+
# def read_root():
|
| 37 |
+
# """
|
| 38 |
+
# Root endpoint for checking the API status.
|
| 39 |
|
| 40 |
+
# Returns a welcome message.
|
| 41 |
+
# """
|
| 42 |
+
# return {"message": "Welcome to My Awesome API!"}
|
| 43 |
|
| 44 |
# ----------------------------
|
| 45 |
# 1. Medical RAG Chatbot
|
docker-compose.yml
CHANGED
|
@@ -1,17 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
services:
|
| 2 |
backend:
|
| 3 |
build:
|
| 4 |
-
context: .
|
| 5 |
-
dockerfile:
|
| 6 |
container_name: backend
|
| 7 |
ports:
|
| 8 |
- "8000:8000"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
restart: always
|
| 10 |
|
| 11 |
frontend:
|
| 12 |
build:
|
| 13 |
-
context: .
|
| 14 |
-
dockerfile:
|
| 15 |
container_name: frontend
|
| 16 |
ports:
|
| 17 |
- "7860:7860"
|
|
@@ -19,4 +47,6 @@ services:
|
|
| 19 |
- BASE_URL=http://backend:8000
|
| 20 |
depends_on:
|
| 21 |
- backend
|
| 22 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
# services:
|
| 2 |
+
# backend:
|
| 3 |
+
# build:
|
| 4 |
+
# context: .
|
| 5 |
+
# dockerfile: Src/Dockerfile
|
| 6 |
+
# container_name: backend
|
| 7 |
+
# ports:
|
| 8 |
+
# - "8000:8000"
|
| 9 |
+
# restart: always
|
| 10 |
+
|
| 11 |
+
# frontend:
|
| 12 |
+
# build:
|
| 13 |
+
# context: .
|
| 14 |
+
# dockerfile: Frontend/Dockerfile
|
| 15 |
+
# container_name: frontend
|
| 16 |
+
# ports:
|
| 17 |
+
# - "7860:7860"
|
| 18 |
+
# environment:
|
| 19 |
+
# - BASE_URL=http://backend:8000
|
| 20 |
+
# depends_on:
|
| 21 |
+
# - backend
|
| 22 |
+
# restart: always
|
| 23 |
+
|
| 24 |
+
|
| 25 |
services:
|
| 26 |
backend:
|
| 27 |
build:
|
| 28 |
+
context: ./Src
|
| 29 |
+
dockerfile: Dockerfile
|
| 30 |
container_name: backend
|
| 31 |
ports:
|
| 32 |
- "8000:8000"
|
| 33 |
+
volumes:
|
| 34 |
+
- ../DataBase:/app/DataBase
|
| 35 |
+
- ../Artifacts:/app/Artifacts
|
| 36 |
+
- ../models:/app/models
|
| 37 |
restart: always
|
| 38 |
|
| 39 |
frontend:
|
| 40 |
build:
|
| 41 |
+
context: ./Frontend
|
| 42 |
+
dockerfile: Dockerfile
|
| 43 |
container_name: frontend
|
| 44 |
ports:
|
| 45 |
- "7860:7860"
|
|
|
|
| 47 |
- BASE_URL=http://backend:8000
|
| 48 |
depends_on:
|
| 49 |
- backend
|
| 50 |
+
volumes:
|
| 51 |
+
- ../DataBase:/app/DataBase
|
| 52 |
+
restart: always
|