Skip to content

Commit 8e8e190

Browse files
committed
feat: added proxy for both chat and extractor service
1 parent c6d6e43 commit 8e8e190

5 files changed

Lines changed: 16 additions & 4 deletions

File tree

chat_service/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
level=logging.INFO, format="%(asctime)s [%(levelname)s] %(name)s: %(message)s"
99
)
1010

11-
app = FastAPI()
11+
app = FastAPI(root_path="/chat")
1212

1313
app.include_router(health.router)
1414
app.include_router(chat.router)

docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ services:
3737
- "80:80"
3838
env_file:
3939
- ./nginx_service/.env
40+
depends_on:
41+
- pdf_extraction
42+
- pdf_processor_service
43+
- chat_service
4044

4145
redis:
4246
container_name: redis

nginx_service/example.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
PDF_PROCESSOR_URL=http://pdf_processor_service:8000
2-
PDF_PROCESSOR_URL=http://chat_service:8001
2+
PDF_EXTRACTOR_URL=http://pdf_extraction_service:8000
3+
CHAT_URL=http://chat_service:8000

nginx_service/nginx.conf.template

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ server {
33
server_name localhost;
44

55
location /processor/ {
6-
proxy_pass ${PROCESSOR_URL};
6+
proxy_pass ${PDF_PROCESSOR_URL};
77
}
88

9+
location /extractor/ {
10+
proxy_pass ${PDF_EXTRACTOR_URL};
11+
}
12+
13+
location /chat/ {
14+
proxy_pass ${CHAT_URL};
15+
}
916
}

pdf_extraction_service/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
format="%(asctime)s [%(levelname)s] %(name)s: %(message)s"
99
)
1010

11-
app = FastAPI()
11+
app = FastAPI(root_path="/extractor")
1212

1313
app.include_router(health.router)
1414
app.include_router(extractor.router)

0 commit comments

Comments
 (0)