-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (39 loc) · 1.17 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# If not using CUDA: swap this for ubuntu:22.04
FROM nvcr.io/nvidia/cuda:12.0.0-cudnn8-runtime-ubuntu22.04
ARG PORT=8087
ARG OPENCV_VERSION=4.5.4
# Prevent interactions from tcl?
ENV DEBIAN_FRONTEND noninteractive
# Install python
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y \
python3 \
python3-pip
RUN python3 -m pip install --upgrade pip
## Tesseract
RUN apt install -y \
tesseract-ocr \
libtesseract-dev \
libleptonica-dev \
pkg-config \
curl
# Tessdata (english and OSD)
RUN mkdir /tessdata
RUN curl -LJ -o /tessdata/eng.traineddata https://github.com/tesseract-ocr/tessdata/raw/main/eng.traineddata
RUN curl -LJ -o /tessdata/osd.traineddata https://github.com/tesseract-ocr/tessdata/raw/main/osd.traineddata
## OpenCV
RUN apt-get install -y \
libopencv-dev \
python3-opencv
WORKDIR /adlc
## pip requirements
COPY requirements.txt ./
# RUN apt-get install -y exempi
RUN --mount=type=cache,target=/root/.cache/pip \
python3 -m pip install -r requirements.txt
# Copy source folder
COPY ./adlc ./adlc
# COPY ./data ./data
COPY ./img ./img
COPY ./test ./test
CMD uvicorn adlc.main:app --host 0.0.0.0 --port $PORT