first commit
This commit is contained in:
114
docker-compose.yml
Normal file
114
docker-compose.yml
Normal file
@@ -0,0 +1,114 @@
|
||||
services:
|
||||
ocr_gateway_test:
|
||||
build:
|
||||
context: .
|
||||
image: ocr_gateway_test
|
||||
container_name: ocr_gateway_test
|
||||
restart: always
|
||||
ports:
|
||||
- "8880:8880"
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- TZ=Asia/Seoul
|
||||
- CELERY_BROKER_URL=redis://ocr_gateway_test_redis:6379/0
|
||||
- CELERY_RESULT_BACKEND=redis://ocr_gateway_test_redis:6379/1
|
||||
- TESSDATA_PREFIX=/usr/share/tesseract-ocr/4.00/tessdata
|
||||
- PADDLE_DEVICE=${PADDLE_DEVICE:-gpu}
|
||||
depends_on:
|
||||
ocr_gateway_test_redis:
|
||||
condition: service_healthy
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
count: all
|
||||
capabilities: [gpu]
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD-SHELL",
|
||||
"curl -f http://localhost:8880/health/API && curl -f http://localhost:8880/health/Redis && curl -f http://localhost:8880/health/Celery && curl -f http://localhost:8880/health/Flower",
|
||||
]
|
||||
interval: 60s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
networks:
|
||||
- llm_gateway_test_net
|
||||
|
||||
ocr_gateway_test_worker:
|
||||
build:
|
||||
context: .
|
||||
image: ocr_gateway_test
|
||||
container_name: ocr_gateway_test_worker
|
||||
restart: always
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- TZ=Asia/Seoul
|
||||
- CELERY_BROKER_URL=redis://ocr_gateway_test_redis:6379/0
|
||||
- CELERY_RESULT_BACKEND=redis://ocr_gateway_test_redis:6379/1
|
||||
- TESSDATA_PREFIX=/usr/share/tesseract-ocr/4.00/tessdata
|
||||
- PADDLE_DEVICE=${PADDLE_DEVICE:-gpu}
|
||||
command: celery -A tasks worker --loglevel=info --pool=threads --concurrency=4
|
||||
depends_on:
|
||||
ocr_gateway_test_redis:
|
||||
condition: service_healthy
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
count: all
|
||||
capabilities: [gpu]
|
||||
networks:
|
||||
- llm_gateway_test_net
|
||||
|
||||
ocr_gateway_test_flower:
|
||||
image: mher/flower:latest
|
||||
container_name: ocr_gateway_test_flower
|
||||
restart: always
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- TZ=Asia/Seoul
|
||||
- FLOWER_UNAUTHENTICATED_API=true
|
||||
- TESSDATA_PREFIX=/usr/share/tessdata
|
||||
entrypoint:
|
||||
["sh", "-c", "celery --broker='redis://ocr_gateway_test_redis:6379/0' flower --port=5557"]
|
||||
ports:
|
||||
- "5557:5557"
|
||||
depends_on:
|
||||
ocr_gateway_test_redis:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- llm_gateway_test_net
|
||||
|
||||
ocr_gateway_test_redis:
|
||||
image: redis:7-alpine
|
||||
container_name: ocr_gateway_test_redis
|
||||
command:
|
||||
[
|
||||
"redis-server",
|
||||
"--maxmemory",
|
||||
"256mb",
|
||||
"--maxmemory-policy",
|
||||
"allkeys-lru",
|
||||
]
|
||||
ports:
|
||||
- "6383:6379"
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- llm_gateway_test_net
|
||||
|
||||
networks:
|
||||
llm_gateway_test_net:
|
||||
name: llm_gateway_test_net
|
||||
external: true
|
||||
Reference in New Issue
Block a user