-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
40 lines (39 loc) · 1.15 KB
/
Copy pathdocker-compose.yml
File metadata and controls
40 lines (39 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
services:
ocr-api:
image: yolo-ocr-api:latest
build:
context: .
dockerfile: Dockerfile
container_name: yolo-ocr-api
ports:
- "8000:8000"
environment:
OCR_MAX_WORKERS: "4"
APP_MODULE: "ocr_api:app"
UVICORN_WORKERS: "1"
command: >
sh -c "uvicorn $${APP_MODULE} --host 0.0.0.0 --port 8000 --workers $${UVICORN_WORKERS}"
volumes:
- ./detect:/yolo-ocr/detect
- ./weights:/yolo-ocr/weights:ro
- ./default_rapidocr.yaml:/yolo-ocr/default_rapidocr.yaml:ro
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=3).read()\""]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
labels:
autoheal: "true"
autoheal:
image: willfarrell/autoheal:1.2.0
container_name: yolo-ocr-autoheal
restart: unless-stopped
environment:
AUTOHEAL_CONTAINER_LABEL: autoheal
AUTOHEAL_INTERVAL: 15
AUTOHEAL_START_PERIOD: 60
AUTOHEAL_DEFAULT_STOP_TIMEOUT: 10
volumes:
- /var/run/docker.sock:/var/run/docker.sock