zenaight commited on
Commit ·
3f945f8
1
Parent(s): d1139f1
Update server port in Dockerfile and main.py from 8080 to 7860
Browse files- Changed the exposed port in the Dockerfile and the CMD instruction to 7860, ensuring consistency across the application setup.
- Updated the main.py file to reflect the new port configuration for the uvicorn server, maintaining alignment with the Dockerfile changes.
- These modifications enhance the application's deployment consistency and accessibility.
- Dockerfile +2 -2
- main.py +1 -15
Dockerfile
CHANGED
|
@@ -3,5 +3,5 @@ WORKDIR /code
|
|
| 3 |
COPY requirements.txt .
|
| 4 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 5 |
COPY . .
|
| 6 |
-
EXPOSE
|
| 7 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "
|
|
|
|
| 3 |
COPY requirements.txt .
|
| 4 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 5 |
COPY . .
|
| 6 |
+
EXPOSE 7860
|
| 7 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
main.py
CHANGED
|
@@ -14,20 +14,6 @@ app = FastAPI(title="PropAgent", description="WhatsApp AI Agent with Supabase in
|
|
| 14 |
# Include all API routes
|
| 15 |
app.include_router(router)
|
| 16 |
|
| 17 |
-
# --- Root Endpoint ---
|
| 18 |
-
@app.get("/")
|
| 19 |
-
async def root():
|
| 20 |
-
"""Root endpoint for health check"""
|
| 21 |
-
return {
|
| 22 |
-
"message": "PropAgent WhatsApp AI Agent is running!",
|
| 23 |
-
"status": "healthy",
|
| 24 |
-
"endpoints": {
|
| 25 |
-
"webhook": "/webhook",
|
| 26 |
-
"health": "/health",
|
| 27 |
-
"ping": "/ping"
|
| 28 |
-
}
|
| 29 |
-
}
|
| 30 |
-
|
| 31 |
# --- WhatsApp Webhook Handler ---
|
| 32 |
@app.post("/webhook")
|
| 33 |
async def receive_message(req: Request):
|
|
@@ -127,4 +113,4 @@ async def startup_event():
|
|
| 127 |
|
| 128 |
if __name__ == "__main__":
|
| 129 |
import uvicorn
|
| 130 |
-
uvicorn.run(app, host="0.0.0.0", port=
|
|
|
|
| 14 |
# Include all API routes
|
| 15 |
app.include_router(router)
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
# --- WhatsApp Webhook Handler ---
|
| 18 |
@app.post("/webhook")
|
| 19 |
async def receive_message(req: Request):
|
|
|
|
| 113 |
|
| 114 |
if __name__ == "__main__":
|
| 115 |
import uvicorn
|
| 116 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|