Gemini commited on
Commit ·
bca5a91
1
Parent(s): d1899b1
feat: Re-add debugging ls commands to Dockerfile and revert app.py internal auth
Browse files- Dockerfile +12 -0
- app.py +3 -3
Dockerfile
CHANGED
|
@@ -25,6 +25,12 @@ RUN npm run build
|
|
| 25 |
RUN echo "--- Contents of /app/notion-mcp-server in builder stage (after build):" && ls -laR .
|
| 26 |
# ==========================================================
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
# Stage 2: The "Final" Stage - Create the Python application image
|
| 29 |
FROM python:3.9-slim
|
| 30 |
|
|
@@ -51,6 +57,12 @@ COPY --from=builder /app/notion-mcp-server /app/notion-mcp-server
|
|
| 51 |
RUN echo "--- Contents of /app/notion-mcp-server in final stage (after copy):" && ls -laR /app/notion-mcp-server
|
| 52 |
# ==========================================================
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
# Expose the port
|
| 55 |
EXPOSE 7860
|
| 56 |
|
|
|
|
| 25 |
RUN echo "--- Contents of /app/notion-mcp-server in builder stage (after build):" && ls -laR .
|
| 26 |
# ==========================================================
|
| 27 |
|
| 28 |
+
# ==================== DEBUGGING STEP 1 ====================
|
| 29 |
+
# List the contents of the current directory to verify that the 'dist'
|
| 30 |
+
# directory was created by the build command.
|
| 31 |
+
RUN echo "--- Contents of /app/notion-mcp-server in builder stage (after build):" && ls -laR .
|
| 32 |
+
# ==========================================================
|
| 33 |
+
|
| 34 |
# Stage 2: The "Final" Stage - Create the Python application image
|
| 35 |
FROM python:3.9-slim
|
| 36 |
|
|
|
|
| 57 |
RUN echo "--- Contents of /app/notion-mcp-server in final stage (after copy):" && ls -laR /app/notion-mcp-server
|
| 58 |
# ==========================================================
|
| 59 |
|
| 60 |
+
# ==================== DEBUGGING STEP 2 ====================
|
| 61 |
+
# List the contents of the copied directory to verify that the 'dist'
|
| 62 |
+
# directory was successfully brought into the final image.
|
| 63 |
+
RUN echo "--- Contents of /app/notion-mcp-server in final stage (after copy):" && ls -laR /app/notion-mcp-server
|
| 64 |
+
# ==========================================================
|
| 65 |
+
|
| 66 |
# Expose the port
|
| 67 |
EXPOSE 7860
|
| 68 |
|
app.py
CHANGED
|
@@ -59,7 +59,6 @@ async def proxy_health(request: Request):
|
|
| 59 |
return Response(content="Service Unavailable (Circuit Breaker Open)", status_code=503)
|
| 60 |
|
| 61 |
async with httpx.AsyncClient() as client:
|
| 62 |
-
url = "http://localhost:7860/health"
|
| 63 |
headers = {key: value for key, value in request.headers.items() if key.lower() not in ('host',)}
|
| 64 |
|
| 65 |
try:
|
|
@@ -98,7 +97,6 @@ async def proxy_mcp(request: Request):
|
|
| 98 |
return Response(content="Service Unavailable (Circuit Breaker Open)", status_code=503)
|
| 99 |
|
| 100 |
async with httpx.AsyncClient() as client:
|
| 101 |
-
url = "http://localhost:7860/mcp"
|
| 102 |
headers = {key: value for key, value in request.headers.items() if key.lower() not in ('host',)}
|
| 103 |
|
| 104 |
try:
|
|
@@ -129,7 +127,9 @@ async def proxy_mcp(request: Request):
|
|
| 129 |
|
| 130 |
@app.on_event("startup")
|
| 131 |
async def startup_event():
|
| 132 |
-
|
|
|
|
|
|
|
| 133 |
|
| 134 |
@app.get("/")
|
| 135 |
async def root():
|
|
|
|
| 59 |
return Response(content="Service Unavailable (Circuit Breaker Open)", status_code=503)
|
| 60 |
|
| 61 |
async with httpx.AsyncClient() as client:
|
|
|
|
| 62 |
headers = {key: value for key, value in request.headers.items() if key.lower() not in ('host',)}
|
| 63 |
|
| 64 |
try:
|
|
|
|
| 97 |
return Response(content="Service Unavailable (Circuit Breaker Open)", status_code=503)
|
| 98 |
|
| 99 |
async with httpx.AsyncClient() as client:
|
|
|
|
| 100 |
headers = {key: value for key, value in request.headers.items() if key.lower() not in ('host',)}
|
| 101 |
|
| 102 |
try:
|
|
|
|
| 127 |
|
| 128 |
@app.on_event("startup")
|
| 129 |
async def startup_event():
|
| 130 |
+
global internal_mcp_auth_token
|
| 131 |
+
internal_mcp_auth_token = secrets.token_hex(32) # Generate a random token
|
| 132 |
+
asyncio.create_task(run_mcp_server(internal_mcp_auth_token))
|
| 133 |
|
| 134 |
@app.get("/")
|
| 135 |
async def root():
|