Move the rowing photo Claude call to the Python service
POST /rowing in the Go backend no longer calls the Anthropic SDK. It keeps the admin gate, EXIF date, duplicate check, sanity bounds and insert, and sends the image to a new internal Python route, POST /internal/rowing/read, which makes the Claude call and returns the three numbers it read. The route spends a paid call and has no auth of its own, so nginx 404s /py/internal/ and the route refuses anything carrying the proxy headers nginx adds. The python container now receives CLAUDE_API_KEY. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+6
-2
@@ -394,8 +394,11 @@ services:
|
||||
# OpenAPI/Swagger URLs (/py/docs) are correct even though the app's own
|
||||
# routes are written relative to /.
|
||||
# Note this service uses `environment:` with an explicit allow-list rather
|
||||
# than `env_file: ./.env` — it only gets the three variables it needs and
|
||||
# never sees the database password, Spotify secrets, or API keys.
|
||||
# than `env_file: ./.env` — it only gets the variables it needs and never
|
||||
# sees the database password, Spotify secrets, or the other API keys.
|
||||
# CLAUDE_API_KEY is the one secret on the list: the rowing photo reader
|
||||
# (POST /internal/rowing/read, called by the backend, blocked at nginx) makes
|
||||
# the Claude call that used to live in the Go backend.
|
||||
python:
|
||||
build:
|
||||
context: ./python
|
||||
@@ -408,6 +411,7 @@ services:
|
||||
- PYTHON_PORT=${PYTHON_PORT:-8000}
|
||||
- ROOT_PATH=/py
|
||||
- TFL_APP_KEY=${TFL_APP_KEY:-}
|
||||
- CLAUDE_API_KEY=${CLAUDE_API_KEY:-}
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import urllib.request,os; urllib.request.urlopen(f\"http://localhost:{os.environ.get('PYTHON_PORT','8000')}/health\")"]
|
||||
interval: 30s
|
||||
|
||||
Reference in New Issue
Block a user