refactor: split worker into paid/free via WORKER_PLAN env var
Replace dual-consumer priority WorkerPool with a single consumer per worker process. WORKER_PLAN=paid|free selects the Kafka topic and consumer group ID (dish-recognition-paid / dish-recognition-free). docker-compose now runs worker-paid and worker-free as separate services for independent scaling. Makefile dev target launches both workers locally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -69,7 +69,7 @@ services:
|
||||
volumes:
|
||||
- ./firebase-credentials.json:/app/firebase-credentials.json:ro
|
||||
|
||||
worker:
|
||||
worker-paid:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
@@ -78,10 +78,25 @@ services:
|
||||
DATABASE_URL: postgres://food_ai:food_ai_local@postgres:5432/food_ai?sslmode=disable
|
||||
OPENAI_API_KEY: ${OPENAI_API_KEY}
|
||||
KAFKA_BROKERS: kafka:9092
|
||||
WORKER_PLAN: paid
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
kafka:
|
||||
kafka-init:
|
||||
condition: service_completed_successfully
|
||||
|
||||
worker-free:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
command: ["./worker"]
|
||||
environment:
|
||||
DATABASE_URL: postgres://food_ai:food_ai_local@postgres:5432/food_ai?sslmode=disable
|
||||
OPENAI_API_KEY: ${OPENAI_API_KEY}
|
||||
KAFKA_BROKERS: kafka:9092
|
||||
WORKER_PLAN: free
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
kafka-init:
|
||||
condition: service_completed_successfully
|
||||
|
||||
Reference in New Issue
Block a user