docker-compose files
Some checks failed
build_docker / essential (pull_request) Successful in 0s
build_docker / build_cpu (linux/amd64) (pull_request) Successful in 4m5s
build_docker / build_cpu (linux/arm64) (pull_request) Successful in 19m34s
build_docker / build_gpu (linux/arm64) (pull_request) Successful in 15m56s
build_docker / build_easyocr (linux/amd64) (pull_request) Successful in 12m7s
build_docker / manifest_cpu (pull_request) Has been cancelled
build_docker / manifest_gpu (pull_request) Has been cancelled
build_docker / build_doctr (linux/amd64) (pull_request) Has been cancelled
build_docker / build_doctr (linux/arm64) (pull_request) Has been cancelled
build_docker / manifest_easyocr (pull_request) Has been cancelled
build_docker / manifest_doctr (pull_request) Has been cancelled
build_docker / build_easyocr_gpu (linux/amd64) (pull_request) Has been cancelled
build_docker / build_easyocr_gpu (linux/arm64) (pull_request) Has been cancelled
build_docker / build_doctr_gpu (linux/amd64) (pull_request) Has been cancelled
build_docker / build_doctr_gpu (linux/arm64) (pull_request) Has been cancelled
build_docker / manifest_easyocr_gpu (pull_request) Has been cancelled
build_docker / manifest_doctr_gpu (pull_request) Has been cancelled
build_docker / build_gpu (linux/amd64) (pull_request) Has been cancelled
build_docker / build_easyocr (linux/arm64) (pull_request) Has been cancelled
Some checks failed
build_docker / essential (pull_request) Successful in 0s
build_docker / build_cpu (linux/amd64) (pull_request) Successful in 4m5s
build_docker / build_cpu (linux/arm64) (pull_request) Successful in 19m34s
build_docker / build_gpu (linux/arm64) (pull_request) Successful in 15m56s
build_docker / build_easyocr (linux/amd64) (pull_request) Successful in 12m7s
build_docker / manifest_cpu (pull_request) Has been cancelled
build_docker / manifest_gpu (pull_request) Has been cancelled
build_docker / build_doctr (linux/amd64) (pull_request) Has been cancelled
build_docker / build_doctr (linux/arm64) (pull_request) Has been cancelled
build_docker / manifest_easyocr (pull_request) Has been cancelled
build_docker / manifest_doctr (pull_request) Has been cancelled
build_docker / build_easyocr_gpu (linux/amd64) (pull_request) Has been cancelled
build_docker / build_easyocr_gpu (linux/arm64) (pull_request) Has been cancelled
build_docker / build_doctr_gpu (linux/amd64) (pull_request) Has been cancelled
build_docker / build_doctr_gpu (linux/arm64) (pull_request) Has been cancelled
build_docker / manifest_easyocr_gpu (pull_request) Has been cancelled
build_docker / manifest_doctr_gpu (pull_request) Has been cancelled
build_docker / build_gpu (linux/amd64) (pull_request) Has been cancelled
build_docker / build_easyocr (linux/arm64) (pull_request) Has been cancelled
This commit is contained in:
@@ -35,20 +35,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& ln -sf /usr/bin/python3.12 /usr/bin/python
|
&& ln -sf /usr/bin/python3.12 /usr/bin/python
|
||||||
|
|
||||||
# Install PyTorch with CUDA support
|
# Copy requirements first for better caching
|
||||||
# cu128 index has both amd64 and arm64 wheels
|
COPY requirements.txt .
|
||||||
RUN python -m pip install --no-cache-dir \
|
|
||||||
|
# Install PyTorch with CUDA support first (cu128 index has amd64 + arm64 wheels)
|
||||||
|
RUN python -m pip install --no-cache-dir --break-system-packages \
|
||||||
torch torchvision --index-url https://download.pytorch.org/whl/cu128
|
torch torchvision --index-url https://download.pytorch.org/whl/cu128
|
||||||
|
|
||||||
# Install DocTR and other dependencies
|
# Install remaining dependencies from requirements.txt (skip torch, already installed)
|
||||||
RUN python -m pip install --no-cache-dir \
|
RUN grep -v "^torch" requirements.txt | python -m pip install --no-cache-dir --break-system-packages -r /dev/stdin
|
||||||
"python-doctr[torch]>=0.8.0" \
|
|
||||||
fastapi>=0.104.0 \
|
|
||||||
"uvicorn[standard]" \
|
|
||||||
pydantic>=2.0.0 \
|
|
||||||
jiwer>=3.0.0 \
|
|
||||||
numpy>=1.24.0 \
|
|
||||||
pillow>=10.0.0
|
|
||||||
|
|
||||||
# Copy application code
|
# Copy application code
|
||||||
COPY doctr_tuning_rest.py .
|
COPY doctr_tuning_rest.py .
|
||||||
|
|||||||
61
src/doctr_service/docker-compose.yml
Normal file
61
src/doctr_service/docker-compose.yml
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
# docker-compose.yml - DocTR REST API
|
||||||
|
# Usage:
|
||||||
|
# CPU: docker compose up ocr-cpu
|
||||||
|
# GPU: docker compose up ocr-gpu
|
||||||
|
#
|
||||||
|
# Port: 8003
|
||||||
|
|
||||||
|
services:
|
||||||
|
# CPU-only service
|
||||||
|
ocr-cpu:
|
||||||
|
image: seryus.ddns.net/unir/doctr-cpu:latest
|
||||||
|
container_name: doctr-cpu
|
||||||
|
ports:
|
||||||
|
- "8003:8000"
|
||||||
|
volumes:
|
||||||
|
- ../dataset:/app/dataset:ro
|
||||||
|
- doctr-cache:/root/.cache/doctr
|
||||||
|
environment:
|
||||||
|
- PYTHONUNBUFFERED=1
|
||||||
|
- DOCTR_DET_ARCH=db_resnet50
|
||||||
|
- DOCTR_RECO_ARCH=crnn_vgg16_bn
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
start_period: 180s
|
||||||
|
|
||||||
|
# GPU service (requires NVIDIA Container Toolkit)
|
||||||
|
ocr-gpu:
|
||||||
|
image: seryus.ddns.net/unir/doctr-gpu:latest
|
||||||
|
container_name: doctr-gpu
|
||||||
|
ports:
|
||||||
|
- "8003:8000"
|
||||||
|
volumes:
|
||||||
|
- ../dataset:/app/dataset:ro
|
||||||
|
- doctr-cache:/root/.cache/doctr
|
||||||
|
environment:
|
||||||
|
- PYTHONUNBUFFERED=1
|
||||||
|
- CUDA_VISIBLE_DEVICES=0
|
||||||
|
- DOCTR_DET_ARCH=db_resnet50
|
||||||
|
- DOCTR_RECO_ARCH=crnn_vgg16_bn
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
reservations:
|
||||||
|
devices:
|
||||||
|
- driver: nvidia
|
||||||
|
count: 1
|
||||||
|
capabilities: [gpu]
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
start_period: 180s
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
doctr-cache:
|
||||||
|
name: doctr-model-cache
|
||||||
@@ -34,20 +34,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& ln -sf /usr/bin/python3.12 /usr/bin/python
|
&& ln -sf /usr/bin/python3.12 /usr/bin/python
|
||||||
|
|
||||||
# Install PyTorch with CUDA support
|
# Copy requirements first for better caching
|
||||||
# cu128 index has both amd64 and arm64 wheels
|
COPY requirements.txt .
|
||||||
RUN python -m pip install --no-cache-dir \
|
|
||||||
|
# Install PyTorch with CUDA support first (cu128 index has amd64 + arm64 wheels)
|
||||||
|
RUN python -m pip install --no-cache-dir --break-system-packages \
|
||||||
torch torchvision --index-url https://download.pytorch.org/whl/cu128
|
torch torchvision --index-url https://download.pytorch.org/whl/cu128
|
||||||
|
|
||||||
# Install EasyOCR and other dependencies
|
# Install remaining dependencies from requirements.txt (skip torch, already installed)
|
||||||
RUN python -m pip install --no-cache-dir \
|
RUN grep -v "^torch" requirements.txt | python -m pip install --no-cache-dir --break-system-packages -r /dev/stdin
|
||||||
easyocr>=1.7.0 \
|
|
||||||
fastapi>=0.104.0 \
|
|
||||||
"uvicorn[standard]" \
|
|
||||||
pydantic>=2.0.0 \
|
|
||||||
jiwer>=3.0.0 \
|
|
||||||
numpy>=1.24.0 \
|
|
||||||
pillow>=10.0.0
|
|
||||||
|
|
||||||
# Copy application code
|
# Copy application code
|
||||||
COPY easyocr_tuning_rest.py .
|
COPY easyocr_tuning_rest.py .
|
||||||
|
|||||||
59
src/easyocr_service/docker-compose.yml
Normal file
59
src/easyocr_service/docker-compose.yml
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
# docker-compose.yml - EasyOCR REST API
|
||||||
|
# Usage:
|
||||||
|
# CPU: docker compose up ocr-cpu
|
||||||
|
# GPU: docker compose up ocr-gpu
|
||||||
|
#
|
||||||
|
# Port: 8002
|
||||||
|
|
||||||
|
services:
|
||||||
|
# CPU-only service
|
||||||
|
ocr-cpu:
|
||||||
|
image: seryus.ddns.net/unir/easyocr-cpu:latest
|
||||||
|
container_name: easyocr-cpu
|
||||||
|
ports:
|
||||||
|
- "8002:8000"
|
||||||
|
volumes:
|
||||||
|
- ../dataset:/app/dataset:ro
|
||||||
|
- easyocr-cache:/root/.EasyOCR
|
||||||
|
environment:
|
||||||
|
- PYTHONUNBUFFERED=1
|
||||||
|
- EASYOCR_LANGUAGES=es,en
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
start_period: 120s
|
||||||
|
|
||||||
|
# GPU service (requires NVIDIA Container Toolkit)
|
||||||
|
ocr-gpu:
|
||||||
|
image: seryus.ddns.net/unir/easyocr-gpu:latest
|
||||||
|
container_name: easyocr-gpu
|
||||||
|
ports:
|
||||||
|
- "8002:8000"
|
||||||
|
volumes:
|
||||||
|
- ../dataset:/app/dataset:ro
|
||||||
|
- easyocr-cache:/root/.EasyOCR
|
||||||
|
environment:
|
||||||
|
- PYTHONUNBUFFERED=1
|
||||||
|
- CUDA_VISIBLE_DEVICES=0
|
||||||
|
- EASYOCR_LANGUAGES=es,en
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
reservations:
|
||||||
|
devices:
|
||||||
|
- driver: nvidia
|
||||||
|
count: 1
|
||||||
|
capabilities: [gpu]
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
start_period: 120s
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
easyocr-cache:
|
||||||
|
name: easyocr-model-cache
|
||||||
Reference in New Issue
Block a user