Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- Dockerfile +1 -7
- app.py +1 -3
Dockerfile
CHANGED
@@ -1,18 +1,12 @@
|
|
1 |
-
# Use a base image with Python
|
2 |
FROM python:3.10
|
3 |
|
4 |
-
# Set the working directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
# Copy the app files
|
8 |
COPY . .
|
9 |
|
10 |
-
# Install dependencies
|
11 |
RUN pip install --no-cache-dir --upgrade pip && \
|
12 |
pip install -r requirements.txt
|
13 |
|
14 |
-
# Install Gunicorn (if not in requirements.txt)
|
15 |
RUN pip install gunicorn uvicorn
|
16 |
|
17 |
-
|
18 |
-
CMD ["gunicorn", "-w", "4", "-k", "uvicorn.workers.UvicornWorker", "app:app", "--bind", "0.0.0.0:7860"]
|
|
|
|
|
1 |
FROM python:3.10
|
2 |
|
|
|
3 |
WORKDIR /app
|
4 |
|
|
|
5 |
COPY . .
|
6 |
|
|
|
7 |
RUN pip install --no-cache-dir --upgrade pip && \
|
8 |
pip install -r requirements.txt
|
9 |
|
|
|
10 |
RUN pip install gunicorn uvicorn
|
11 |
|
12 |
+
CMD ["gunicorn", "-w", "3", "-k", "uvicorn.workers.UvicornWorker", "app:app", "--bind", "0.0.0.0:7860"]
|
|
app.py
CHANGED
@@ -73,8 +73,6 @@ async def sms_interactions(request: Request):
|
|
73 |
print(f"body_data: {body_data}")
|
74 |
return { "body": "DOne"}
|
75 |
|
76 |
-
|
77 |
-
|
78 |
@app.get('/generate_token_stage')
|
79 |
async def generate_token(request: Request):
|
80 |
agent_token = request.query_params.get("agent_token")
|
@@ -186,7 +184,7 @@ class MessageRequestValidate(BaseModel):
|
|
186 |
@app.post('/realtor/validate')
|
187 |
async def realtor_validate_user(request: MessageRequestValidate):
|
188 |
print(request)
|
189 |
-
if request.from_phone == "+
|
190 |
return JSONResponse(content="User is verified")
|
191 |
return JSONResponse(content="user is not verified")
|
192 |
|
|
|
73 |
print(f"body_data: {body_data}")
|
74 |
return { "body": "DOne"}
|
75 |
|
|
|
|
|
76 |
@app.get('/generate_token_stage')
|
77 |
async def generate_token(request: Request):
|
78 |
agent_token = request.query_params.get("agent_token")
|
|
|
184 |
@app.post('/realtor/validate')
|
185 |
async def realtor_validate_user(request: MessageRequestValidate):
|
186 |
print(request)
|
187 |
+
if request.from_phone == "+91738905885":
|
188 |
return JSONResponse(content="User is verified")
|
189 |
return JSONResponse(content="user is not verified")
|
190 |
|