mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
move docker compose back to categorisation directory and define simple invoke script
This commit is contained in:
parent
b4e3dc9f42
commit
478947b8da
2 changed files with 36 additions and 0 deletions
11
backend/categorisation/local_handler/docker-compose.yml
Normal file
11
backend/categorisation/local_handler/docker-compose.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
version: "3.9"
|
||||
|
||||
services:
|
||||
categorisation-lambda:
|
||||
build:
|
||||
context: ../../../
|
||||
dockerfile: backend/categorisation/handler/Dockerfile
|
||||
ports:
|
||||
- "9000:8080"
|
||||
env_file:
|
||||
- ../../../.env
|
||||
25
backend/categorisation/local_handler/invoke_local_lambda.py
Normal file
25
backend/categorisation/local_handler/invoke_local_lambda.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env python3
|
||||
import json
|
||||
import requests
|
||||
|
||||
LAMBDA_URL = "http://localhost:9000/2015-03-31/functions/function/invocations"
|
||||
|
||||
payload = {
|
||||
"Records": [
|
||||
{
|
||||
"body": json.dumps(
|
||||
{
|
||||
"portfolio_id": 556,
|
||||
"plans_to_consider": [],
|
||||
"plan_priority_order": [],
|
||||
}
|
||||
)
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
response = requests.post(LAMBDA_URL, json=payload)
|
||||
|
||||
print("Status code:", response.status_code)
|
||||
print("Response:")
|
||||
print(response.text)
|
||||
Loading…
Add table
Reference in a new issue