-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
38 lines (27 loc) · 919 Bytes
/
Dockerfile
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
# Use the official Debian slim image as a base
FROM debian:stable-slim
# Install Paddle OCR and necessary dependencies
RUN apt-get update && \
apt-get install -y \
python3 \
python3-pip \
python3-venv \
python3-opencv \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /usr/paddle-ocr/
ENV VIRTUAL_ENV=venv
# Create a virtual environment and install dependencies
RUN python3 -m venv venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Copy models
COPY models/ /usr/paddle-ocr/models/
# Copy requirements.txt
COPY requirements.txt /usr/paddle-ocr/
COPY config.json /usr/paddle-ocr/
RUN pip install --no-cache-dir -r requirements.txt
# COPY python/ /usr/autotag-tesseract/python/
# RUN pip install /usr/autotag-tesseract/python/pdfix_sdk-8.2.0.tar.gz
# Copy the source code
COPY src/ /usr/paddle-ocr/src/
ENTRYPOINT ["/usr/paddle-ocr/venv/bin/python3", "/usr/paddle-ocr/src/main.py"]