First commit
This commit is contained in:
95
docker-compose.yml
Normal file
95
docker-compose.yml
Normal file
@@ -0,0 +1,95 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
api:
|
||||
build: ./api
|
||||
container_name: cheque-scanner-api
|
||||
ports:
|
||||
- "8001:8000"
|
||||
depends_on:
|
||||
- redis
|
||||
volumes:
|
||||
- shared_data:/app/data
|
||||
- ./shared:/app/shared
|
||||
environment:
|
||||
- REDIS_URL=redis://redis:6379/0
|
||||
- UPLOAD_FOLDER=/app/data/uploads
|
||||
- RESULT_FOLDER=/app/data/results
|
||||
- TEMP_FOLDER=/app/data/tmp
|
||||
- DEBUG=false
|
||||
- API_KEY=${API_KEY:-your-secret-api-key}
|
||||
- MAX_WORKERS=3
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- cheque-scanner-network
|
||||
|
||||
worker:
|
||||
build: ./worker
|
||||
depends_on:
|
||||
- redis
|
||||
volumes:
|
||||
- shared_data:/app/data
|
||||
- ./shared:/app/shared
|
||||
- ./api/app:/app/api_app
|
||||
environment:
|
||||
- REDIS_URL=redis://redis:6379/0
|
||||
- UPLOAD_FOLDER=/app/data/uploads
|
||||
- RESULT_FOLDER=/app/data/results
|
||||
- TEMP_FOLDER=/app/data/tmp
|
||||
- QUEUE_NAME=cheque_processing
|
||||
- HIGH_PRIORITY_QUEUE_NAME=cheque_processing_high
|
||||
- TESSERACT_DATA_PATH=/usr/share/tesseract-ocr/4.00/tessdata
|
||||
- DEFAULT_OCR_LANGUAGE=eng
|
||||
- ALTERNATIVE_OCR_LANGUAGE=fra
|
||||
deploy:
|
||||
replicas: ${WORKER_REPLICAS:-2}
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- cheque-scanner-network
|
||||
|
||||
# Service supplémentaire pour traiter les requêtes prioritaires
|
||||
priority-worker:
|
||||
build: ./worker
|
||||
depends_on:
|
||||
- redis
|
||||
volumes:
|
||||
- shared_data:/app/data
|
||||
- ./shared:/app/shared
|
||||
- ./api/app:/app/api_app
|
||||
environment:
|
||||
- REDIS_URL=redis://redis:6379/0
|
||||
- UPLOAD_FOLDER=/app/data/uploads
|
||||
- RESULT_FOLDER=/app/data/results
|
||||
- TEMP_FOLDER=/app/data/tmp
|
||||
- QUEUE_NAME=cheque_processing_high
|
||||
- TESSERACT_DATA_PATH=/usr/share/tesseract-ocr/4.00/tessdata
|
||||
- DEFAULT_OCR_LANGUAGE=eng
|
||||
- ALTERNATIVE_OCR_LANGUAGE=fra
|
||||
- WORKER_NAME=priority-worker
|
||||
entrypoint: ["/priority_entrypoint.sh"]
|
||||
command: ["python", "worker.py", "--queues", "cheque_processing_high", "--name", "priority-worker"]
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- cheque-scanner-network
|
||||
|
||||
redis:
|
||||
image: redis:alpine
|
||||
container_name: cheque-scanner-redis
|
||||
ports:
|
||||
- "6380:6379"
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
command: ["redis-server", "--appendonly", "yes"]
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- cheque-scanner-network
|
||||
|
||||
volumes:
|
||||
shared_data:
|
||||
name: cheque-scanner-shared-data
|
||||
redis_data:
|
||||
name: cheque-scanner-redis-data
|
||||
|
||||
networks:
|
||||
cheque-scanner-network:
|
||||
name: cheque-scanner-network
|
||||
Reference in New Issue
Block a user